diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-02-07 13:05:33 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-03-01 22:30:27 +0000 |
commit | 816b56f878f0291c00a9018d5057b7b2b00f1891 (patch) | |
tree | 50fbe6df105bfb70aa315a376432ed5e5a48304c /runtime/lua/vim/lsp/_watchfiles.lua | |
parent | bf1e098d971d455cba1bdc9f6b2e777572fd6b16 (diff) | |
download | rneovim-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.lua | 9 |
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 |