aznhe21 / actions-preview.nvim

Fully customizable previewer for LSP code actions.
GNU General Public License v3.0
365 stars 9 forks source link

only consider code actions for diagnostics under cursor - issue and PR in neovim core that is relevant here #40

Open IndianBoy42 opened 3 months ago

IndianBoy42 commented 3 months ago

https://github.com/neovim/neovim/pull/25747

I see quite a lot of duplication of the vim.lsp.buf.code_actions code here, I wonder if there is a better architecture that would remove the need for that.

The docs say the real customization point is vim.ui.select (https://github.com/neovim/neovim/blob/2980dcd33c9028a2aaad56494e00786fdb439e2f/runtime/lua/vim/lsp/buf.lua#L579), perhaps there is a way to override that that doesn't clobber the user config too badly. vim.ui.select is called with kind = "codeaction" so a wrapper could be made that does the preview for codeactions and defers to the users vim.ui.select for the rest