From 16f781e627a8ed2da94a38b0969f11fbcf73777f Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 20 Jul 2024 16:51:51 +0300 Subject: [PATCH] deprecate nvimCodeActionMenu --- configuration.nix | 7 +++- modules/extra/deprecations.nix | 7 ++++ .../fastaction-nvim}/default.nix | 2 +- .../lsp/nvim-code-action-menu/config.nix | 38 ------------------- .../nvim-code-action-menu.nix | 20 ---------- 5 files changed, 14 insertions(+), 60 deletions(-) rename modules/plugins/lsp/{nvim-code-action-menu => code-actions/fastaction-nvim}/default.nix (55%) delete mode 100644 modules/plugins/lsp/nvim-code-action-menu/config.nix delete mode 100644 modules/plugins/lsp/nvim-code-action-menu/nvim-code-action-menu.nix diff --git a/configuration.nix b/configuration.nix index b0c613b..35cb0bd 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,11 +17,16 @@ isMaximal: { lspkind.enable = false; lightbulb.enable = true; lspsaga.enable = false; - nvimCodeActionMenu.enable = isMaximal; trouble.enable = true; lspSignature.enable = true; lsplines.enable = isMaximal; nvim-docs-view.enable = isMaximal; + + # Code Actions + code-actions = { + enable = true; + fastaction-nvim.enable = true; + }; }; debugger = { diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index cb06380..8809092 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -7,5 +7,12 @@ in { Tidalcycles language support has been removed as of 2024-06-06 as it was long unmaintained. If you depended on this functionality, please open an issue. '') + + # 2024-07-20 + (mkRemovedOptionModule ["vim" "lsp" "nvimCodeActionMenu"] '' + nvimCodeActionMenu has been deprecated and archived upstream. As of 0.7, code-actions will be + available under `vim.lsp.code-actions.enable` and `vim.lsp.code.actions..enable`. + Please take a look at the nvf manual for more details. + '') ]; } diff --git a/modules/plugins/lsp/nvim-code-action-menu/default.nix b/modules/plugins/lsp/code-actions/fastaction-nvim/default.nix similarity index 55% rename from modules/plugins/lsp/nvim-code-action-menu/default.nix rename to modules/plugins/lsp/code-actions/fastaction-nvim/default.nix index f94dd22..ecac8b8 100644 --- a/modules/plugins/lsp/nvim-code-action-menu/default.nix +++ b/modules/plugins/lsp/code-actions/fastaction-nvim/default.nix @@ -1,6 +1,6 @@ { imports = [ - ./nvim-code-action-menu.nix ./config.nix + ./fastaction-nvim.nix ]; } diff --git a/modules/plugins/lsp/nvim-code-action-menu/config.nix b/modules/plugins/lsp/nvim-code-action-menu/config.nix deleted file mode 100644 index 145cb60..0000000 --- a/modules/plugins/lsp/nvim-code-action-menu/config.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib.modules) mkIf; - inherit (lib.nvim.dag) entryAnywhere; - inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault; - inherit (lib.nvim.lua) toLuaObject; - - cfg = config.vim.lsp; - - self = import ./nvim-code-action-menu.nix {inherit lib;}; - mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings; - mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions; -in { - config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) { - vim = { - startPlugins = ["nvim-code-action-menu"]; - - maps.normal = mkSetBinding mappings.open ":CodeActionMenu"; - - binds.whichKey.register = pushDownDefault { - "c" = "+CodeAction"; - }; - - pluginRC.code-action-menu = entryAnywhere '' - -- border configuration - vim.g.code_action_menu_window_border = ${toLuaObject 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/plugins/lsp/nvim-code-action-menu/nvim-code-action-menu.nix b/modules/plugins/lsp/nvim-code-action-menu/nvim-code-action-menu.nix deleted file mode 100644 index c303f7c..0000000 --- a/modules/plugins/lsp/nvim-code-action-menu/nvim-code-action-menu.nix +++ /dev/null @@ -1,20 +0,0 @@ -{lib, ...}: let - inherit (lib.options) mkEnableOption; - inherit (lib.nvim.binds) mkMappingOption; -in { - options.vim.lsp = { - nvimCodeActionMenu = { - enable = mkEnableOption "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"; - }; - }; - }; -}