aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/_watchfiles.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-02-07 13:05:33 +0000
committerLewis Russell <lewis6991@gmail.com>2024-03-01 22:30:27 +0000
commit816b56f878f0291c00a9018d5057b7b2b00f1891 (patch)
tree50fbe6df105bfb70aa315a376432ed5e5a48304c /runtime/lua/vim/lsp/_watchfiles.lua
parentbf1e098d971d455cba1bdc9f6b2e777572fd6b16 (diff)
downloadrneovim-816b56f878f0291c00a9018d5057b7b2b00f1891.tar.gz
rneovim-816b56f878f0291c00a9018d5057b7b2b00f1891.tar.bz2
rneovim-816b56f878f0291c00a9018d5057b7b2b00f1891.zip
fix(lsp): cancel watchers when closing a client
Diffstat (limited to 'runtime/lua/vim/lsp/_watchfiles.lua')
-rw-r--r--runtime/lua/vim/lsp/_watchfiles.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/_watchfiles.lua b/runtime/lua/vim/lsp/_watchfiles.lua
index 220052be5f..c66a76feae 100644
--- a/runtime/lua/vim/lsp/_watchfiles.lua
+++ b/runtime/lua/vim/lsp/_watchfiles.lua
@@ -167,5 +167,14 @@ function M.unregister(unreg, ctx)
end
end
+--- @param client_id integer
+function M.cancel(client_id)
+ for _, reg_cancels in pairs(cancels[client_id]) do
+ for _, cancel in pairs(reg_cancels) do
+ cancel()
+ end
+ end
+end
+
return M