mirror of
https://github.com/neovim/neovim
synced 2025-07-17 17:51:48 +00:00
fix(lsp): don't update active_clients on exit_timeout (#16192)
This commit is contained in:
@ -1255,27 +1255,30 @@ function lsp._vim_exit_handler()
|
|||||||
send_kill = true
|
send_kill = true
|
||||||
timeouts[client_id] = timeout
|
timeouts[client_id] = timeout
|
||||||
max_timeout = math.max(timeout, max_timeout)
|
max_timeout = math.max(timeout, max_timeout)
|
||||||
else
|
|
||||||
active_clients[client_id] = nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local poll_time = 50
|
local poll_time = 50
|
||||||
|
|
||||||
local function check_clients_closed()
|
local function check_clients_closed()
|
||||||
|
for client_id, timeout in pairs(timeouts) do
|
||||||
|
timeouts[client_id] = timeout - poll_time
|
||||||
|
end
|
||||||
|
|
||||||
for client_id, _ in pairs(active_clients) do
|
for client_id, _ in pairs(active_clients) do
|
||||||
timeouts[client_id] = timeouts[client_id] - poll_time
|
if timeouts[client_id] ~= nil and timeouts[client_id] > 0 then
|
||||||
if timeouts[client_id] < 0 then
|
return false
|
||||||
active_clients[client_id] = nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return tbl_isempty(active_clients)
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
if send_kill then
|
if send_kill then
|
||||||
if not vim.wait(max_timeout, check_clients_closed, poll_time) then
|
if not vim.wait(max_timeout, check_clients_closed, poll_time) then
|
||||||
for _, client in pairs(active_clients) do
|
for client_id, client in pairs(active_clients) do
|
||||||
client.stop(true)
|
if timeouts[client_id] ~= nil then
|
||||||
|
client.stop(true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user