From ebb7c38ca2e59ca7b413750d83ac1cf38d7bb180 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 26 Nov 2025 01:17:06 -0500 Subject: docs: misc fix https://github.com/neovim/neovim.github.io/issues/419 Co-authored-by: Rob Pilling --- runtime/lua/vim/lsp.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'runtime/lua/vim/lsp.lua') 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 -- cgit