diff --git a/configuration.nix b/configuration.nix index b0c613b..7479012 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,7 +17,6 @@ isMaximal: { lspkind.enable = false; lightbulb.enable = true; lspsaga.enable = false; - nvimCodeActionMenu.enable = isMaximal; trouble.enable = true; lspSignature.enable = true; lsplines.enable = isMaximal; @@ -204,6 +203,7 @@ isMaximal: { go = ["90" "130"]; }; }; + fastaction.enable = true; }; assistant = { diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index ce5d8bd..cf250e0 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -4,6 +4,8 @@ Release notes for release 0.7 ## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide-0-7} +### `vim.configRC` removed {#sec-vim-configrc-removed} + In v0.7 we are removing `vim.configRC` in favor of making `vim.luaConfigRC` the top-level DAG, and thereby making the entire configuration Lua based. This change introduces a few breaking changes: @@ -24,6 +26,17 @@ making good use of its extensive Lua API. Additionally, Vimscript is slow and brings unnecessary performance overhead while working with different configuration formats. +### `vim.lsp.nvimCodeActionMenu` removed in favor of `vim.ui.fastaction` {#sec-nvim-code-action-menu-deprecation} + +The nvim-code-action-menu plugin has been archived and broken for a long time, +so it's being replaced with a young, but better alternative called +fastaction.nvim. Simply remove everything set under +`vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`. + +Note that we are looking to add more alternatives in the future like +dressing.nvim and actions-preview.nvim, in case fastaction doesn't work for +everyone. + ## Changelog {#sec-release-0.7-changelog} [ItsSorae](https://github.com/ItsSorae): @@ -103,6 +116,9 @@ configuration formats. yourself by adding `vim.opt.listchars:append({ eol = '' })` to your lua configuration +- Replace `vim.lsp.nvimCodeActionMenu` with `vim.ui.fastaction`, see the + breaking changes section above for more details + [Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd() - Make Neovim's configuration file entirely Lua based. This comes with a few diff --git a/flake.lock b/flake.lock index 574e222..a39bf46 100644 --- a/flake.lock +++ b/flake.lock @@ -571,6 +571,22 @@ "type": "github" } }, + "plugin-fastaction-nvim": { + "flake": false, + "locked": { + "lastModified": 1721396662, + "narHash": "sha256-L7na78FsE+QHlEwxMpiwQcoOPhtmrknvdTZfzUoDANI=", + "owner": "Chaitanyabsprip", + "repo": "fastaction.nvim", + "rev": "2384dea7ba81d2709d0bee0e4bc7a8831ff13a9d", + "type": "github" + }, + "original": { + "owner": "Chaitanyabsprip", + "repo": "fastaction.nvim", + "type": "github" + } + }, "plugin-fidget-nvim": { "flake": false, "locked": { @@ -1052,22 +1068,6 @@ "type": "github" } }, - "plugin-nvim-code-action-menu": { - "flake": false, - "locked": { - "lastModified": 1702287297, - "narHash": "sha256-pY+aP9iBuJhvDZzVEsOHZmnfaq3vUP7TfKEEQrj+Mo8=", - "owner": "weilbith", - "repo": "nvim-code-action-menu", - "rev": "8c7672a4b04d3cc4edd2c484d05b660a9cb34a1b", - "type": "github" - }, - "original": { - "owner": "weilbith", - "repo": "nvim-code-action-menu", - "type": "github" - } - }, "plugin-nvim-colorizer-lua": { "flake": false, "locked": { @@ -1855,6 +1855,7 @@ "plugin-dracula": "plugin-dracula", "plugin-dressing-nvim": "plugin-dressing-nvim", "plugin-elixir-tools": "plugin-elixir-tools", + "plugin-fastaction-nvim": "plugin-fastaction-nvim", "plugin-fidget-nvim": "plugin-fidget-nvim", "plugin-flutter-tools": "plugin-flutter-tools", "plugin-gesture-nvim": "plugin-gesture-nvim", @@ -1885,7 +1886,6 @@ "plugin-nvim-autopairs": "plugin-nvim-autopairs", "plugin-nvim-bufferline-lua": "plugin-nvim-bufferline-lua", "plugin-nvim-cmp": "plugin-nvim-cmp", - "plugin-nvim-code-action-menu": "plugin-nvim-code-action-menu", "plugin-nvim-colorizer-lua": "plugin-nvim-colorizer-lua", "plugin-nvim-cursorline": "plugin-nvim-cursorline", "plugin-nvim-dap": "plugin-nvim-dap", diff --git a/flake.nix b/flake.nix index c00e9b8..0684972 100644 --- a/flake.nix +++ b/flake.nix @@ -133,8 +133,8 @@ flake = false; }; - plugin-nvim-code-action-menu = { - url = "github:weilbith/nvim-code-action-menu"; + plugin-fastaction-nvim = { + url = "github:Chaitanyabsprip/fastaction.nvim"; flake = false; }; diff --git a/flake/modules/home-manager.nix b/flake/modules/home-manager.nix index 66a3552..77b8448 100644 --- a/flake/modules/home-manager.nix +++ b/flake/modules/home-manager.nix @@ -67,7 +67,6 @@ in { formatOnSave = true; lightbulb.enable = true; lspsaga.enable = false; - nvimCodeActionMenu.enable = true; trouble.enable = true; lspSignature.enable = true; rust.enable = false; diff --git a/flake/modules/nixos.nix b/flake/modules/nixos.nix index e1e81f1..022b3d9 100644 --- a/flake/modules/nixos.nix +++ b/flake/modules/nixos.nix @@ -67,7 +67,6 @@ in { formatOnSave = true; lightbulb.enable = true; lspsaga.enable = false; - nvimCodeActionMenu.enable = true; trouble.enable = true; lspSignature.enable = true; rust.enable = false; diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index cb06380..388913a 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 removed upstream. As of 0.7, fastaction will be + available under `vim.ui.fastaction` as a replacement. Simply remove everything under + `vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`. + '') ]; } diff --git a/modules/plugins/lsp/default.nix b/modules/plugins/lsp/default.nix index f8408aa..a5d5163 100644 --- a/modules/plugins/lsp/default.nix +++ b/modules/plugins/lsp/default.nix @@ -10,7 +10,6 @@ # lsp plugins ./lspsaga - ./nvim-code-action-menu ./trouble ./lsp-signature ./lightbulb diff --git a/modules/plugins/lsp/lspsaga/config.nix b/modules/plugins/lsp/lspsaga/config.nix index 71c9025..6605087 100644 --- a/modules/plugins/lsp/lspsaga/config.nix +++ b/modules/plugins/lsp/lspsaga/config.nix @@ -36,7 +36,7 @@ in { (mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')") (mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')") - (mkIf (!cfg.nvimCodeActionMenu.enable) (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action")) + (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action") (mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help")) ]; }; 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"; - }; - }; - }; -} diff --git a/modules/plugins/ui/borders/borders.nix b/modules/plugins/ui/borders/borders.nix index 9951591..cf19d38 100644 --- a/modules/plugins/ui/borders/borders.nix +++ b/modules/plugins/ui/borders/borders.nix @@ -43,7 +43,7 @@ in { lspsaga = mkPluginStyleOption "lspsaga"; nvim-cmp = mkPluginStyleOption "nvim-cmp"; lsp-signature = mkPluginStyleOption "lsp-signature"; - code-action-menu = mkPluginStyleOption "code-actions-menu"; + fastaction = mkPluginStyleOption "fastaction"; }; }; } diff --git a/modules/plugins/ui/default.nix b/modules/plugins/ui/default.nix index 262cdbb..3407660 100644 --- a/modules/plugins/ui/default.nix +++ b/modules/plugins/ui/default.nix @@ -8,5 +8,6 @@ ./illuminate ./breadcrumbs ./borders + ./fastaction ]; } diff --git a/modules/plugins/ui/fastaction/config.nix b/modules/plugins/ui/fastaction/config.nix new file mode 100644 index 0000000..79c3e25 --- /dev/null +++ b/modules/plugins/ui/fastaction/config.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf mkDefault; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.ui.fastaction; + borderCfg = config.vim.ui.borders.plugins.fastaction; +in { + config = mkIf cfg.enable { + vim = { + ui.fastaction.setupOpts = { + register_ui_select = mkDefault true; + popup.border = mkIf borderCfg.enable borderCfg.style; + }; + + startPlugins = ["fastaction-nvim"]; + pluginRC.fastaction = entryAnywhere "require('fastaction').setup(${toLuaObject cfg.setupOpts})"; + }; + }; +} diff --git a/modules/plugins/lsp/nvim-code-action-menu/default.nix b/modules/plugins/ui/fastaction/default.nix similarity index 55% rename from modules/plugins/lsp/nvim-code-action-menu/default.nix rename to modules/plugins/ui/fastaction/default.nix index f94dd22..ef5c2bc 100644 --- a/modules/plugins/lsp/nvim-code-action-menu/default.nix +++ b/modules/plugins/ui/fastaction/default.nix @@ -1,6 +1,6 @@ { imports = [ - ./nvim-code-action-menu.nix + ./fastaction-nvim.nix ./config.nix ]; } diff --git a/modules/plugins/ui/fastaction/fastaction-nvim.nix b/modules/plugins/ui/fastaction/fastaction-nvim.nix new file mode 100644 index 0000000..52ac59a --- /dev/null +++ b/modules/plugins/ui/fastaction/fastaction-nvim.nix @@ -0,0 +1,9 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.ui.fastaction = { + enable = mkEnableOption "overriding vim.ui.select with fastaction.nvim"; + setupOpts = mkPluginSetupOption "fastaction" {}; + }; +} diff --git a/modules/plugins/visuals/config.nix b/modules/plugins/visuals/config.nix index 1dfc661..1457ff3 100644 --- a/modules/plugins/visuals/config.nix +++ b/modules/plugins/visuals/config.nix @@ -45,8 +45,6 @@ in { 'noice', 'NvimTree', 'alpha', - 'code-action-menu-menu', - 'code-action-menu-warning-message', 'notify', 'Navbuddy' },