diff options
author | Jaehwang Jung <tomtomjhj@gmail.com> | 2025-01-02 17:33:16 +0900 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2025-01-02 10:23:06 +0000 |
commit | 9d9ee3476e6478850ce8822c85154f0c98570371 (patch) | |
tree | 05d37c5e24bfac34e69235248772730b7c643ca2 /runtime/lua/vim/lsp/client.lua | |
parent | efe1732c6fd802ca8fdccc1f0a26be87427f1e70 (diff) | |
download | rneovim-9d9ee3476e6478850ce8822c85154f0c98570371.tar.gz rneovim-9d9ee3476e6478850ce8822c85154f0c98570371.tar.bz2 rneovim-9d9ee3476e6478850ce8822c85154f0c98570371.zip |
fix(lsp): ensure watcher cancel
* Cancel watcher in the "force" case.
* Cancel watcher outside the async callback. It seems nvim doesn't wait
async jobs on quitting, leaving detached inotifywait processes.
* Clean up cancelling callbacks.
Diffstat (limited to 'runtime/lua/vim/lsp/client.lua')
-rw-r--r-- | runtime/lua/vim/lsp/client.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/client.lua b/runtime/lua/vim/lsp/client.lua index d51a45b473..5d11312c77 100644 --- a/runtime/lua/vim/lsp/client.lua +++ b/runtime/lua/vim/lsp/client.lua @@ -805,6 +805,8 @@ function Client:stop(force) return end + vim.lsp._watchfiles.cancel(self.id) + if force or not self.initialized or self._graceful_shutdown_failed then rpc.terminate() return @@ -819,7 +821,6 @@ function Client:stop(force) rpc.terminate() self._graceful_shutdown_failed = true end - vim.lsp._watchfiles.cancel(self.id) end) end |