Skip to content

chore: don't accept multiple arguments in :LspStop/LspRestart #3896

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ Most of the time, the reason for failure is present in the logs.

* `:LspInfo` (alias to `:checkhealth vim.lsp`) shows the status of active and configured language servers.
* `:LspStart <config_name>` Start the requested server name. Will only successfully start if the command detects a root directory matching the current config.
* `:LspStop [<client_id_or_name> ...]` Stops the given server(s). Defaults to stopping all servers active on the current buffer. To force stop add `++force`
* `:LspRestart [<client_id_or_name> ...]` Restarts the given client(s), and attempts to reattach to all previously attached buffers. Defaults to restarting all active servers.
* `:LspStop [<client_id_or_name>]` Stops the given server. Defaults to stopping all servers active on the current buffer. To force stop add `++force`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

off-topic/future: why didn't we use ! instead of ++force to "force" ...?

* `:LspRestart [<client_id_or_name>]` Restarts the given client, and attempts to reattach to all previously attached buffers. Defaults to restarting all active servers.

## Contributions

Expand Down
8 changes: 4 additions & 4 deletions doc/lspconfig.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ Launches the requested (configured) client, but only if it successfully
resolves a root directory. Note: Defaults to all configured servers matching
the current buffer filetype.

:LspStop [client_id] or [config_name] ... *:LspStop*
Stops the servers with the given client-ids or config names. Defaults to
:LspStop [client_id] or [config_name] *:LspStop*
Stops the server with the given client-id or config name. Defaults to
stopping all servers active on the current buffer. To force stop language
servers: >vim
:LspStop ++force

:LspRestart [client_id] or [config_name] ... *:LspRestart*
Restarts the clients with the given client-ids or config names, and attempts
:LspRestart [client_id] or [config_name] *:LspRestart*
Restarts the client with the given client-id or config name, and attempts
to reattach to all previously attached buffers. Defaults to restarting all
active servers.

Expand Down
8 changes: 4 additions & 4 deletions plugin/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ if vim.version.ge(vim.version(), { 0, 11, 2 }) then
end
end)
end, {
desc = 'Restart the given client(s)',
nargs = '*',
desc = 'Restart the given client',
nargs = '?',
complete = complete_client,
})

Expand All @@ -175,8 +175,8 @@ if vim.version.ge(vim.version(), { 0, 11, 2 }) then
end
end
end, {
desc = 'Disable and stop the given client(s)',
nargs = '*',
desc = 'Disable and stop the given client',
nargs = '?',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought it would simplify the implementation too :)

well, let's try it for now and see how it goes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we still need to handle multiple servers in the default case with no arguments 😀

Thanks for the merge!

complete = complete_client,
})

Expand Down