-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set per-client commands to start_client? #1750
Comments
Hmm, yes. I'm not quite sure what to do with this. Maybe |
Is the problem here that the I am running into a similar thing. i can bypass the error the OP here sees by setting the value in the commands dictionary to a list commands = {
["elixir.lens.test.run"] = {
function()
-- stuff
end,
},
}, but when it actually goes to run the the client side command in response when attempting to run the code lens (in this case, run a unit test), it fails because the command is a table and not a function.
Sorry if I just repeated something obvious, but wanted to clarify this. |
Also, because the key in the command table needs to be the command sent by the code lens, i get a failure when it tries to create neovim commands from the name
|
It is only used for the former. And it's not possible to pass client side command handlers this way, thus this issue. I've found a workaround, though. You can actually set the per-client command handler in |
#1838 should address this by renaming the key for creating user_commands (via nvim_create_user_commands) to |
Description
neovim/neovim#16101 makes it possible to use per-client command handlers.
However, there seems to be no way to actually pass this to
start_client
call.Neovim version
NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Nvim-lspconfig version
c276536
Operating system and version
ArchLinux 5.16.11-zen1-1-zen
Affected language servers
all
Steps to reproduce
Per documentation, the following should work, but in fact doesn't:
Because lspconfig takes the
commands
key as a different meaning, as explained in thelspconfig-configurations
section of the documentation.
So the above code errors out as it doesn't pass the check.
I'm aware of
vim.lsp.commands
as a workaround but I think it should be possible to make use of neovim/neovim#16101 and set custom command handlers.Or at least the documentation should be updated to mention the different meaning of the
commands
key when passed tosetup
.Actual behavior
Error during start up:
Expected behavior
No response
Minimal config
LSP log
https://gist.github.com/Aetf/a7279f4adde759bb2060aeb773961b42
The text was updated successfully, but these errors were encountered: