Skip to content

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

Merged

Conversation

toupeira
Copy link
Contributor

@toupeira toupeira commented Jun 6, 2025

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

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 = '*',
Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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

Copy link
Contributor Author

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.

Comment on lines 115 to 117
for _, name in ipairs(servers) do
vim.lsp.enable(name)
end
Copy link
Member

@justinmk justinmk Jun 8, 2025

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"

Suggested change
for _, name in ipairs(servers) do
vim.lsp.enable(name)
end
vim.lsp.enable(servers)

@justinmk
Copy link
Member

justinmk commented Jun 8, 2025

Thanks! Is this needed for :LspRestart too? #3892

@justinmk justinmk merged commit a182334 into neovim:master Jun 8, 2025
5 of 6 checks passed
@toupeira toupeira deleted the fix/lsp-start-stop-without-arguments branch June 9, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LspStart and LspRestart need an argument to run
2 participants