fix(lsp): default ClientConfig.exit_timeout to false #36811

This commit is contained in:
Olivia Kinnear
2025-12-03 00:58:46 -05:00
committed by GitHub
parent 2bbc90f4d5
commit e62dd13f83
3 changed files with 6 additions and 8 deletions

View File

@@ -1593,7 +1593,7 @@ Lua module: vim.lsp.client *lsp-client*
|vim.lsp.ClientConfig|. |vim.lsp.ClientConfig|.
• {dynamic_capabilities} (`lsp.DynamicCapabilities`) Capabilities • {dynamic_capabilities} (`lsp.DynamicCapabilities`) Capabilities
provided at runtime (after startup). provided at runtime (after startup).
• {exit_timeout} (`integer|boolean`, default: `3000`) • {exit_timeout} (`integer|boolean`, default: `false`)
Milliseconds to wait for server to exit Milliseconds to wait for server to exit
cleanly after sending the "shutdown" request cleanly after sending the "shutdown" request
before sending kill -15. If set to false, before sending kill -15. If set to false,
@@ -1720,7 +1720,7 @@ Lua module: vim.lsp.client *lsp-client*
process on exit, but if Nvim fails to exit process on exit, but if Nvim fails to exit
cleanly this could leave behind orphaned server cleanly this could leave behind orphaned server
processes. processes.
• {exit_timeout}? (`integer|boolean`, default: `3000`) • {exit_timeout}? (`integer|boolean`, default: `false`)
Milliseconds to wait for server to exit cleanly Milliseconds to wait for server to exit cleanly
after sending the "shutdown" request before after sending the "shutdown" request before
sending kill -15. If set to false, waits sending kill -15. If set to false, waits

View File

@@ -277,12 +277,10 @@ LSP
• |Client:stop()| now accepts a numerical `force` argument to be interpreted as the time to wait • |Client:stop()| now accepts a numerical `force` argument to be interpreted as the time to wait
before forcing the shutdown. before forcing the shutdown.
• Add cmp field to opts of |vim.lsp.completion.enable()| for custom completion ordering. • Add cmp field to opts of |vim.lsp.completion.enable()| for custom completion ordering.
• |vim.lsp.enable()| when `enable == false` now force stops the client when it
takes too long to shutdown after being disabled.
• Push diagnostics (|vim.lsp.diagnostic.on_publish_diagnostics()|) now respect • Push diagnostics (|vim.lsp.diagnostic.on_publish_diagnostics()|) now respect
the `version` property in the notification params. the `version` property in the notification params.
• |vim.lsp.ClientConfig| has an `exit_timeout` field to control the timeout of • |vim.lsp.ClientConfig| has an `exit_timeout` field to control the timeout of
client force stopping. Defaults to 3000 milliseconds. client force stopping. Defaults to `false`.
LUA LUA

View File

@@ -72,7 +72,7 @@ local all_clients = {}
--- Milliseconds to wait for server to exit cleanly after sending the "shutdown" request before --- 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 --- sending kill -15. If set to false, waits indefinitely. If set to true, nvim will kill the
--- server immediately. --- server immediately.
--- (default: `3000`) --- (default: `false`)
--- @field exit_timeout? integer|boolean --- @field exit_timeout? integer|boolean
--- ---
--- A table with flags for the client. The current (experimental) flags are: --- A table with flags for the client. The current (experimental) flags are:
@@ -160,7 +160,7 @@ local all_clients = {}
--- Milliseconds to wait for server to exit cleanly after sending the "shutdown" request before --- 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 --- sending kill -15. If set to false, waits indefinitely. If set to true, nvim will kill the
--- server immediately. --- server immediately.
--- (default: `3000`) --- (default: `false`)
--- @field exit_timeout integer|boolean --- @field exit_timeout integer|boolean
--- ---
--- A table with flags for the client. The current (experimental) flags are: --- A table with flags for the client. The current (experimental) flags are:
@@ -398,7 +398,7 @@ function Client.create(config)
commands = config.commands or {}, commands = config.commands or {},
settings = config.settings or {}, settings = config.settings or {},
flags = config.flags or {}, flags = config.flags or {},
exit_timeout = config.exit_timeout == nil and 3000 or config.exit_timeout --[[@as integer|boolean]], exit_timeout = config.exit_timeout or false,
get_language_id = config.get_language_id or default_get_language_id, get_language_id = config.get_language_id or default_get_language_id,
capabilities = config.capabilities, capabilities = config.capabilities,
workspace_folders = lsp._get_workspace_folders(config.workspace_folders or config.root_dir), workspace_folders = lsp._get_workspace_folders(config.workspace_folders or config.root_dir),