aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-03-04 12:27:46 -0800
committerGitHub <noreply@github.com>2021-03-04 12:27:46 -0800
commitc50b737d6f953e1c4240c2e24693ce49932cdaf6 (patch)
treef13ea4571d12694264881e6de97a866ce09e3b14 /runtime/lua/vim/lsp.lua
parentf2fc44d50b511cb3cbffaf9ec4f37d1e7995aac7 (diff)
parentbdb251232517ef29f37f88f16b11ed567c7c0df2 (diff)
downloadrneovim-c50b737d6f953e1c4240c2e24693ce49932cdaf6.tar.gz
rneovim-c50b737d6f953e1c4240c2e24693ce49932cdaf6.tar.bz2
rneovim-c50b737d6f953e1c4240c2e24693ce49932cdaf6.zip
Merge pull request #14047 from mjlbach/feature/notify_on_crash
lsp: invoke vim.notify when client exits with code or signal other than 0
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r--runtime/lua/vim/lsp.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 143909fe41..fdff8e3661 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -542,6 +542,13 @@ function lsp.start_client(config)
client_ids[client_id] = nil
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
pcall(config.on_exit, code, signal, client_id)
end