aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/client.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2026-02-12 14:16:47 +0100
committerJustin M. Keyes <justinkz@gmail.com>2026-03-11 18:00:18 +0100
commitb8a976afdaf0080498e85530fae65a3165f201d5 (patch)
treedf9889722d148f6d97f3821264a7c0255d5bee8b /runtime/lua/vim/lsp/client.lua
parent4aeeaa80273eda1cf4fdb5de4b8ea65a16cefbaf (diff)
downloadrneovim-b8a976afdaf0080498e85530fae65a3165f201d5.tar.gz
rneovim-b8a976afdaf0080498e85530fae65a3165f201d5.tar.bz2
rneovim-b8a976afdaf0080498e85530fae65a3165f201d5.zip
docs: api, messages, lsp, trust
gen_vimdoc.lua: In prepare for the upcoming release, comment-out the "Experimental" warning for prerelease features.
Diffstat (limited to 'runtime/lua/vim/lsp/client.lua')
-rw-r--r--runtime/lua/vim/lsp/client.lua35
1 files changed, 17 insertions, 18 deletions
diff --git a/runtime/lua/vim/lsp/client.lua b/runtime/lua/vim/lsp/client.lua
index d98f1c000f..635c2cde76 100644
--- a/runtime/lua/vim/lsp/client.lua
+++ b/runtime/lua/vim/lsp/client.lua
@@ -68,9 +68,11 @@ local all_clients = {}
--- (default: `true`)
--- @field detached? boolean
---
---- Milliseconds to wait for server to exit cleanly after sending the "shutdown" request before
---- sending kill -15. If set to false, waits indefinitely. If set to true, nvim will kill the
---- server immediately.
+--- Decides if/when to force-stop the server after sending the "shutdown" request. See |Client:stop()|.
+--- Note: when Nvim itself is exiting,
+--- - `false`: Nvim will not force-stop LSP server(s).
+--- - `true`: Nvim will force-stop LSP server(s) that did not comply with the "shutdown" request.
+--- - `number`: Nvim will wait up to `exit_timeout` milliseconds before performing force-stop.
--- (default: `false`)
--- @field exit_timeout? integer|boolean
---
@@ -156,9 +158,7 @@ local all_clients = {}
--- Capabilities provided at runtime (after startup).
--- @field dynamic_capabilities lsp.DynamicCapabilities
---
---- Milliseconds to wait for server to exit cleanly after sending the "shutdown" request before
---- sending kill -15. If set to false, waits indefinitely. If set to true, nvim will kill the
---- server immediately.
+--- See [vim.lsp.ClientConfig].
--- (default: `false`)
--- @field exit_timeout integer|boolean
---
@@ -852,20 +852,19 @@ end
--- Stops a client, optionally with force after a timeout.
---
---- By default, it will request the server to shutdown, then force a shutdown
---- if the server has not exited after `self.exit_timeout` milliseconds. If
---- you request to stop a client which has previously been requested to
---- shutdown, it will automatically escalate and force shutdown immediately,
---- regardless of the value of `force` (or `self.exit_timeout` if `nil`).
+--- By default this sends a "shutdown" request to the server, escalating to force-stop if the server
+--- has not exited after `self.exit_timeout` milliseconds (unless `exit_timeout=false`).
+--- Calling stop() on a client that was previously requested to shutdown, will escalate to
+--- force-stop immediately, regardless of `force` (or `self.exit_timeout` if `force=nil`).
---
---- Note: Forcing shutdown while a server is busy writing out project or index
---- files can lead to file corruption.
+--- Note: Forcing shutdown while a server is busy writing out project or index files can lead to
+--- file corruption.
---
---- @param force? integer|boolean Time in milliseconds to wait before forcing
---- a shutdown. If false, only request the
---- server to shutdown, but don't force it. If
---- true, force a shutdown immediately.
---- (default: `self.exit_timeout`)
+--- @param force? integer|boolean (default: `self.exit_timeout`) Decides whether to force-stop the server.
+--- - `nil`: Defaults to `exit_timeout` from |vim.lsp.ClientConfig|.
+--- - `true`: Force-stop after "shutdown" request.
+--- - `false`: Do not force-stop after "shutdown" request.
+--- - number: Wait up to `force` milliseconds before force-stop.
function Client:stop(force)
validate('force', force, { 'number', 'boolean' }, true)