telescope-lsp-handlers.nvim icon indicating copy to clipboard operation
telescope-lsp-handlers.nvim copied to clipboard

Code actions handler broken on Neovim master

Open rmagatti opened this issue 2 years ago • 9 comments

Hey @gbrlsnchs I think one of the more recent changes on master broke the code actions handler this plugin overrides.

I believe this is the culprit PR that introduced the breaking change. https://github.com/neovim/neovim/pull/15818

Specifically this

This changes the code_action and range_code_action implementations to no longer call the global textDocument/codeAction handler.

I'm a bit unclear on how to fix this myself. As far as I understand one would somehow override the vim.ui.select or something?

rmagatti avatar Sep 29 '21 21:09 rmagatti

I have no idea how to fix this as well. Have you found a solution for this, in case someone else also needs to work around this issue?

gbrlsnchs avatar Nov 02 '21 21:11 gbrlsnchs

@gbrlsnchs yeah so now that this PR is merged this plugin should be able to override vim.ui.select taking the new kind variable into consideration and like the documentation says infer the structure coming back to then show the desired UI per kind. e.g if (kind == 'codeaction') then show_codeaction_ui() end

That said the premise this plugin was built on, i.e that it could just override each handler differently is no longer valid in latest master without explicitly doing the lsp calls itself or overriding vim.ui.select.

rmagatti avatar Nov 03 '21 00:11 rmagatti

@rmagatti you could fallback to the default vim.ui.select when kind ~= 'codeaction', or maybe telescope replacing vim.ui.select could be its own plugin. it is definitely awkward either way, i'm still mildly confused as to why they removed the codeaction handler but ¯_(ツ)_/¯

goolord avatar Nov 18 '21 01:11 goolord

Yeah i kind of know what needs to be done now, just been lacking the time to do it tbh. Soon™.

rmagatti avatar Nov 18 '21 04:11 rmagatti

Since I'm not using Telescope at the moment, I'm afraid I won't be able to help actively, but I will readily accept working PRs from users of this plugin. :smiley:

gbrlsnchs avatar Nov 18 '21 15:11 gbrlsnchs

Also, have you seen https://github.com/nvim-telescope/telescope-ui-select.nvim? Not sure if that helps somehow.

gbrlsnchs avatar Nov 19 '21 20:11 gbrlsnchs

Also, have you seen https://github.com/nvim-telescope/telescope-ui-select.nvim? Not sure if that helps somehow.

I just set it up yesterday to test it out. Honestly I think it achieves similar results but I have yet to assess further.

rmagatti avatar Nov 20 '21 02:11 rmagatti

Update: I've successfully switched to telescope-ui-select.nvim for my use case.

rmagatti avatar Dec 16 '21 07:12 rmagatti

Tip: Use dressing.nvim: https://github.com/stevearc/dressing.nvim

It does what telescope-ui-select.nvim does but better, having the priority to use telescope but falling back to others it if is not found, and also works for vim.ui.input

bellini666 avatar Dec 21 '21 13:12 bellini666