From 7b89a3ad259a80cac49a4e7df7e5618ea2e99df7 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 30 Jul 2023 19:13:05 +0300 Subject: [PATCH] feat: provide configuration options for nvim-code-action-menu --- modules/lsp/nvim-code-action-menu/config.nix | 10 ++++++++++ .../nvim-code-action-menu/nvim-code-action-menu.nix | 6 ++++++ modules/ui/borders/borders.nix | 1 + 3 files changed, 17 insertions(+) diff --git a/modules/lsp/nvim-code-action-menu/config.nix b/modules/lsp/nvim-code-action-menu/config.nix index 20c402b..8fd54e5 100644 --- a/modules/lsp/nvim-code-action-menu/config.nix +++ b/modules/lsp/nvim-code-action-menu/config.nix @@ -16,5 +16,15 @@ in { vim.startPlugins = ["nvim-code-action-menu"]; vim.maps.normal = mkSetBinding mappings.open ":CodeActionMenu"; + + vim.luaConfigRC.code-action-menu = nvim.dag.entryAnywhere '' + -- border configuration + vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}' + + -- show individual sections of the code action menu + ${lib.optionalString (cfg.nvimCodeActionMenu.show.details) "vim.g.code_action_menu_show_details = true"} + ${lib.optionalString (cfg.nvimCodeActionMenu.show.diff) "vim.g.code_action_menu_show_diff = true"} + ${lib.optionalString (cfg.nvimCodeActionMenu.show.actionKind) "vim.g.code_action_menu_show_action_kind = true"} + ''; }; } diff --git a/modules/lsp/nvim-code-action-menu/nvim-code-action-menu.nix b/modules/lsp/nvim-code-action-menu/nvim-code-action-menu.nix index 83885e2..651ba4a 100644 --- a/modules/lsp/nvim-code-action-menu/nvim-code-action-menu.nix +++ b/modules/lsp/nvim-code-action-menu/nvim-code-action-menu.nix @@ -4,6 +4,12 @@ with lib; { nvimCodeActionMenu = { enable = mkEnableOption "Enable nvim code action menu"; + show = { + details = mkEnableOption "Show details" // {default = true;}; + diff = mkEnableOption "Show diff" // {default = true;}; + actionKind = mkEnableOption "Show action kind" // {default = true;}; + }; + mappings = { open = mkMappingOption "Open code action menu [nvim-code-action-menu]" "ca"; }; diff --git a/modules/ui/borders/borders.nix b/modules/ui/borders/borders.nix index 179de44..e4a0f39 100644 --- a/modules/ui/borders/borders.nix +++ b/modules/ui/borders/borders.nix @@ -38,6 +38,7 @@ in { lspsaga = mkPluginStyleOption "lspsaga"; nvim-cmp = mkPluginStyleOption "nvim-cmp"; lsp-signature = mkPluginStyleOption "lsp-signature"; + code-action-menu = mkPluginStyleOption "code-actions-menu"; }; }; }