lsp: invoke vim.notify when client exits with code or signal other than 0

This commit is contained in:
Michael Lingelbach
2021-03-02 12:36:35 -08:00
parent c1fbc2ddf1
commit bdb2512325

View File

@@ -542,6 +542,13 @@ function lsp.start_client(config)
client_ids[client_id] = nil client_ids[client_id] = nil
end end
if code ~= 0 or signal ~= 0 then
local msg = string.format("Client %s quit with exit code %s and signal %s", client_id, code, signal)
vim.schedule(function()
vim.notify(msg, vim.log.levels.WARN)
end)
end
if config.on_exit then if config.on_exit then
pcall(config.on_exit, code, signal, client_id) pcall(config.on_exit, code, signal, client_id)
end end