williamboman / nvim-config

My neovim config files
80 stars 8 forks source link

Need help: code actions from multiple sources are not collated #1

Closed ajitid closed 3 years ago

ajitid commented 3 years ago

Apologies for bothering you again.

I noticed that in your setup code actions from tsserver and ESLint appear in a single popup and it looks like in your config Telescope code action is called as it is. I'm not able to understand why in my setup code actions for LSPs come one after the other and not simultaneously.

ss

Have you faced a similar problem? I'm new to Vim and am facing issues in setting up few things. Any help will be appreciated!

williamboman commented 3 years ago

So the telescope variant in your recording seem to be suffering from the bug where telescope only displays code actions from the very first language server. I've opened a fix for this (https://github.com/nvim-telescope/telescope.nvim/pull/722) which will likely be merged soon.

The other variant, where you're calling the builtin neovim LSP function, seems to simply dispatch the textDocument/codeAction request to all LSP servers connected to the current buffer. It does so without providing a handler, which results in the default handler for textDocument/codeAction being executed. Since you have two LSP servers running (tsserver & eslint), that handler will be executed twice, i.e. you will be prompted twice.