mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
refactor(lsp): inline on_client_exit
This commit is contained in:
@@ -1252,6 +1252,28 @@ function Client:_on_exit(code, signal)
|
||||
end
|
||||
end)
|
||||
|
||||
-- Schedule the deletion of the client object so that it exists in the execution of LspDetach
|
||||
-- autocommands
|
||||
vim.schedule(function()
|
||||
all_clients[self.id] = nil
|
||||
|
||||
-- Client can be absent if executable starts, but initialize fails
|
||||
-- init/attach won't have happened
|
||||
if self then
|
||||
changetracking.reset(self)
|
||||
end
|
||||
if code ~= 0 or (signal ~= 0 and signal ~= 15) then
|
||||
local msg = string.format(
|
||||
'Client %s quit with exit code %s and signal %s. Check log for errors: %s',
|
||||
self and self.name or 'unknown',
|
||||
code,
|
||||
signal,
|
||||
lsp.get_log_path()
|
||||
)
|
||||
vim.notify(msg, vim.log.levels.WARN)
|
||||
end
|
||||
end)
|
||||
|
||||
self:_run_callbacks(
|
||||
self._on_exit_cbs,
|
||||
lsp.client_errors.ON_EXIT_CALLBACK_ERROR,
|
||||
|
||||
Reference in New Issue
Block a user