-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: restore :LspStart/LspStop behaviour without arguments #3890
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
fix: restore :LspStart/LspStop behaviour without arguments #3890
Conversation
After the refactoring in e4d1c8b for Neovim 0.11.2 these commands now require an argument. This restores the previous behaviour where `:LspStart` defaults to enabling all servers matching the filetype of the current buffer, and `:LspStop` defaults to disabling all servers attached to the current buffer.
else | ||
vim.lsp.enable(name, false) | ||
end | ||
end | ||
end, { | ||
desc = 'Disable and stop the given client(s)', | ||
nargs = '+', | ||
nargs = '*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed some inconsistencies here:
- We should probably use "servers" instead of "clients" in all user-facing descriptions etc.
:LspStop
takes multiple arguments but:LspStart
only one (or zero now).
Happy to change these too in this PR if nobody objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use "servers" instead of "clients" in all user-facing descriptions etc
Only for cases where "server" is the least confusing name. Doesn't look like the case here.
In old versions of this repo "servers" (as opposed to "configs" or "clients") was used everywhere in a nonsensical way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:LspStop
takes multiple arguments but:LspStart
only one (or zero now).
let's finish this pr first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for cases where "server" is the least confusing name. Doesn't look like the case here.
In old versions of this repo "servers" (as opposed to "configs" or "clients") was used everywhere in a nonsensical way.
@justinmk okay I figured maybe for users "servers" would make the most sense (and I did just mean changing the user-facing parts, not internal variable names), but you definitely have more insight here 😀
:LspStop takes multiple arguments but :LspStart only one (or zero now).
I pushed #3896 for that now.
plugin/lspconfig.lua
Outdated
for _, name in ipairs(servers) do | ||
vim.lsp.enable(name) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable() accepts a list. this is a case where "configs" might be less confusing than "servers". we are enabling configs, which may eventually start a client and a server. we aren't really enabling "servers"
for _, name in ipairs(servers) do | |
vim.lsp.enable(name) | |
end | |
vim.lsp.enable(servers) |
Thanks! Is this needed for :LspRestart too? #3892 |
Description
After the refactoring in e4d1c8b for Neovim 0.11.2 these commands now require an argument.
This restores the previous behaviour where
:LspStart
defaults to enabling all servers matching the filetype of the current buffer, and:LspStop
defaults to disabling all servers attached to the current buffer.Context
fix #3892