Diagnostic and actions handlers are missing
lucax88x opened this issue · 7 comments
Do you plan to support those handlers in the near future or are they out of scope?
I am trying to do it myself, but I'm pretty newb with plugins in general, how can I source my luafile and overwrite handlers to test it?
The issue is that Neovim LSP does have a function to retrieve all diagnostics (vim.lsp.diagnostic.get()
) but the handler associated to that function is used to display warnings/erros next to the code so we don't want to mess with that.
So this means we have to create our own command which would call vim.lsp.diagnostic.get()
and process the results. It shouldn't be complicated, I'll do it this week or the next.
About code_action I don't really see the point of using FZF in that case. There is no location to jump to, there is just a list from which to select an action. It's quicker to type 2
to select action 2 than to use FZF I'd say. So it's not a priority but maybe I'll add a command after the one for diagnostics.
Check :h lsp-handler
for creating your handlers and :lua-require
for how lua files are sourced. Basically everything under <neovim config folder>/lua
should be sourced.
Regarding diagnostic, Yeah, I think we could be fine by just providing a EX command that we can use in our remaps instead of using handlers.
Regarding actions, well, to me it happens to have also 10 actions to select from, and FZF can be helpful to filter quickly, and in general to have an unique "popup" system.
I'm working on both right now in branch dev
you can try it out.
Diagnostics works fine, I've added :LspDiagnostics <bufnr>
and :LspDiagnosticsAll
commands.
I haven't tested code actions yet because my LSP servers don't support them. Can you suggest me a LSP server which have some code actions I can try?
TSServer has a lot of actions.
Tomorrow morning I'll try your branch.
Almost perfect.
One side note, if there are no actions, I would print a message.
I've merged dev into main, now the plugin supports diagnostics and code actions. I've also added some logs if there is no code actions or references etc.