diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-04-23 14:52:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 14:52:13 -0700 |
commit | 11728988dcc15984e6b4869b6409b13279dd8c47 (patch) | |
tree | de49e4c3cfb1a350deefa836e3a64d13efedb405 /runtime/lua/vim/lsp.lua | |
parent | 8885ea7f244ee49b0018dc57be84917ea7886c2d (diff) | |
parent | 2a77d9d8a401819b305c99e45b2b403e65a52bae (diff) | |
download | rneovim-11728988dcc15984e6b4869b6409b13279dd8c47.tar.gz rneovim-11728988dcc15984e6b4869b6409b13279dd8c47.tar.bz2 rneovim-11728988dcc15984e6b4869b6409b13279dd8c47.zip |
Merge pull request #14429 from ckipp01/force
[LSP] - Don't automatically force shutdown on second restart.
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r-- | runtime/lua/vim/lsp.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index cb3d4bbe9f..26700288af 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -916,7 +916,7 @@ function lsp.start_client(config) -- Track this so that we can escalate automatically if we've alredy tried a -- graceful shutdown - local tried_graceful_shutdown = false + local graceful_shutdown_failed = false --@private --- Stops a client, optionally with force. --- @@ -938,11 +938,10 @@ function lsp.start_client(config) if handle:is_closing() then return end - if force or (not client.initialized) or tried_graceful_shutdown then + if force or (not client.initialized) or graceful_shutdown_failed then handle:kill(15) return end - tried_graceful_shutdown = true -- Sending a signal after a process has exited is acceptable. rpc.request('shutdown', nil, function(err, _) if err == nil then @@ -950,6 +949,7 @@ function lsp.start_client(config) else -- If there was an error in the shutdown request, then term to be safe. handle:kill(15) + graceful_shutdown_failed = true end end) end |