diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/lsp.txt | 4 | ||||
-rw-r--r-- | runtime/lua/vim/lsp.lua | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index bc924df39b..3732ddf2bd 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -678,6 +678,10 @@ buf_attach_client({bufnr}, {client_id}) *vim.lsp.buf_attach_client()* • {bufnr} (integer) Buffer handle, or 0 for current • {client_id} (integer) Client id + Return: ~ + (boolean) success `true` if client was attached successfully; `false` + otherwise + buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()* Detaches client from the specified buffer. Note: While the server is notified that the text document (buffer) was closed, it is still able to diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 25e69a8006..cb1c101c58 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -1799,6 +1799,7 @@ end --- ---@param bufnr (integer) Buffer handle, or 0 for current ---@param client_id (integer) Client id +---@return boolean success `true` if client was attached successfully; `false` otherwise function lsp.buf_attach_client(bufnr, client_id) validate({ bufnr = { bufnr, 'n', true }, @@ -1887,7 +1888,7 @@ function lsp.buf_attach_client(bufnr, client_id) end if buffer_client_ids[client_id] then - return + return true end -- This is our first time attaching this client to this buffer. buffer_client_ids[client_id] = true |