From 6ef97d96c511d4e947b113076bdd0256cd0d739c Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 5 Mar 2024 23:34:20 +0000 Subject: [PATCH] Add code actions prefix UI Not only does this show a diff of the selected code action before you apply it, it uses Telescope for display and selection of the desired code action. --- lua/plugins/completions.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua index 663ab5a..69eba36 100644 --- a/lua/plugins/completions.lua +++ b/lua/plugins/completions.lua @@ -13,6 +13,9 @@ return { 'hrsh7th/cmp-cmdline', -- Source for command-line 'hrsh7th/nvim-cmp', -- Completion engine combines and use the above + -- LSP UI plugins + 'aznhe21/actions-preview.nvim', + -- Lue vim module support in lua language server 'folke/neodev.nvim', @@ -108,7 +111,8 @@ return { -- coc.nvim was being weird about it -- Fixit mapping, or close enough, actually any code action - vim.keymap.set('n', 'fi', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'fi', + require("actions-preview").code_actions, opts) -- Goto definition mapping vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)