From 73660af2e36e9881c6cf7d82600950785b4cd51d Mon Sep 17 00:00:00 2001 From: Omar Abragh Date: Tue, 10 Dec 2024 22:00:51 +0100 Subject: [PATCH] lightbulb: add setupOpts option (#492) Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Co-authored-by: raf --- modules/plugins/lsp/lightbulb/config.nix | 3 ++- modules/plugins/lsp/lightbulb/lightbulb.nix | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/plugins/lsp/lightbulb/config.nix b/modules/plugins/lsp/lightbulb/config.nix index f44c2ddb..f17b8ad9 100644 --- a/modules/plugins/lsp/lightbulb/config.nix +++ b/modules/plugins/lsp/lightbulb/config.nix @@ -5,6 +5,7 @@ }: let inherit (lib.modules) mkIf; inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.lsp; in { @@ -16,7 +17,7 @@ in { vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()') -- Enable trouble diagnostics viewer - require'nvim-lightbulb'.setup() + require'nvim-lightbulb'.setup(${toLuaObject cfg.lightbulb.setupOpts}) ''; }; }; diff --git a/modules/plugins/lsp/lightbulb/lightbulb.nix b/modules/plugins/lsp/lightbulb/lightbulb.nix index ef101a0e..4341cac6 100644 --- a/modules/plugins/lsp/lightbulb/lightbulb.nix +++ b/modules/plugins/lsp/lightbulb/lightbulb.nix @@ -1,9 +1,11 @@ {lib, ...}: let inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; in { options.vim.lsp = { lightbulb = { enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font"; + setupOpts = mkPluginSetupOption "nvim-lightbulb" {}; }; }; }