aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-11-26 01:17:06 -0500
committerJustin M. Keyes <justinkz@gmail.com>2025-12-06 20:33:02 -0500
commitebb7c38ca2e59ca7b413750d83ac1cf38d7bb180 (patch)
tree0c76cb2be97df9433579c7577bd0d425739a2cdf /runtime/lua/vim/lsp.lua
parent45ca080bd184c826bae5c25911430cb4fa5c5528 (diff)
downloadrneovim-ebb7c38ca2e59ca7b413750d83ac1cf38d7bb180.tar.gz
rneovim-ebb7c38ca2e59ca7b413750d83ac1cf38d7bb180.tar.bz2
rneovim-ebb7c38ca2e59ca7b413750d83ac1cf38d7bb180.zip
docs: misc
fix https://github.com/neovim/neovim.github.io/issues/419 Co-authored-by: Rob Pilling <robpilling@gmail.com>
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r--runtime/lua/vim/lsp.lua16
1 files changed, 10 insertions, 6 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 54b7cd047f..233bbe3f3d 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -515,8 +515,11 @@ local function lsp_enable_callback(bufnr)
end
end
---- Auto-starts LSP when a buffer is opened, based on the |lsp-config| `filetypes`, `root_markers`,
---- and `root_dir` fields.
+--- Auto-activates LSP in each buffer based on the |lsp-config| `filetypes`, `root_markers`, and
+--- `root_dir`.
+---
+--- To disable, pass `enable=false`: Stops related clients and servers (force-stops servers after
+--- a timeout, unless `exit_timeout=false`).
---
--- Examples:
---
@@ -549,8 +552,9 @@ end
---@since 13
---
--- @param name string|string[] Name(s) of client(s) to enable.
---- @param enable? boolean `true|nil` to enable, `false` to disable (actively stops and detaches
---- clients as needed, and force stops them if necessary after `client.exit_timeout` milliseconds)
+--- @param enable? boolean If `true|nil`, enables auto-activation of the given LSP config on current
+--- and future buffers. If `false`, disables auto-activation and stops related LSP clients and
+--- servers (force-stops servers after `exit_timeout` milliseconds).
function lsp.enable(name, enable)
validate('name', name, { 'string', 'table' })
@@ -1055,8 +1059,8 @@ end
--- vim.lsp.stop_client(vim.lsp.get_clients())
--- ```
---
---- By default asks the server to shutdown, unless stop was requested
---- already for this client, then force-shutdown is attempted.
+--- By default asks the server to shutdown, unless stop was requested already for this client (then
+--- force-shutdown is attempted, unless `exit_timeout=false`).
---
---@deprecated
---@param client_id integer|integer[]|vim.lsp.Client[] id, list of id's, or list of |vim.lsp.Client| objects