gbrlsnchs / telescope-lsp-handlers.nvim

MIT License
87 stars 9 forks source link

Code actions handler broken on Neovim master #5

Open rmagatti opened 2 years ago

rmagatti commented 2 years ago

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?

gbrlsnchs commented 2 years ago

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?

rmagatti commented 2 years ago

@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.

goolord commented 2 years ago

@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 ¯_(ツ)_/¯

rmagatti commented 2 years ago

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

gbrlsnchs commented 2 years ago

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 commented 2 years ago

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

rmagatti commented 2 years ago

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 commented 2 years ago

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

bellini666 commented 2 years ago

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