mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(lsp): only auto-detach lsp.config clients #33834
Problem: enable() routine detaches clients even if they were manually started and not managed by vim.lsp.config. Solution: Skip clients that aren't managed by vim.lsp.config.
This commit is contained in:
@ -547,7 +547,7 @@ local function lsp_enable_callback(bufnr)
|
||||
-- Stop any clients that no longer apply to this buffer.
|
||||
local clients = lsp.get_clients({ bufnr = bufnr, _uninitialized = true })
|
||||
for _, client in ipairs(clients) do
|
||||
if not can_start(bufnr, client.name, lsp.config[client.name]) then
|
||||
if lsp.config[client.name] and not can_start(bufnr, client.name, lsp.config[client.name]) then
|
||||
lsp.buf_detach_client(bufnr, client.id)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user