mirror of
https://github.com/neovim/neovim.git
synced 2026-04-19 14:00:49 +00:00
fix(lsp): check if client is stopping before reuse #33796
Problem:
Stopping a language server and then calling vim.lsp.start() with the same name/root will return the old language server that's in the middle of shutting down. vim.lsp.start() won't return a new server until the old process has terminated.
Solution:
Introducing a client._is_stopping field that tracks the shutdown phase, preventing the client from being reused.
(cherry picked from commit 0862c1036a)
This commit is contained in:
committed by
github-actions[bot]
parent
e512c9589e
commit
0ed06d7271
@@ -147,7 +147,7 @@ end
|
||||
--- @param config vim.lsp.ClientConfig
|
||||
--- @return boolean
|
||||
local function reuse_client_default(client, config)
|
||||
if client.name ~= config.name then
|
||||
if client.name ~= config.name or client:is_stopped() then
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user