aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
diff options
context:
space:
mode:
authorYi Ming <ofseed@foxmail.com>2026-03-08 10:28:56 +0800
committerLewis Russell <me@lewisr.dev>2026-03-09 11:40:08 +0000
commitd53d542359de09270a625f3357db77d6b03041fa (patch)
tree4c8c44f5e61b856772a65038c700fbb80efa2781 /runtime/lua
parent61f166ec409b7621fcc42e4da40d6ccb19973749 (diff)
downloadrneovim-d53d542359de09270a625f3357db77d6b03041fa.tar.gz
rneovim-d53d542359de09270a625f3357db77d6b03041fa.tar.bz2
rneovim-d53d542359de09270a625f3357db77d6b03041fa.zip
fix(lsp): stop and close timer when `Capability` is destroyed
Diffstat (limited to 'runtime/lua')
-rw-r--r--runtime/lua/vim/lsp/codelens.lua7
-rw-r--r--runtime/lua/vim/lsp/inline_completion.lua1
2 files changed, 8 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua
index f29677fde3..2b89ea971d 100644
--- a/runtime/lua/vim/lsp/codelens.lua
+++ b/runtime/lua/vim/lsp/codelens.lua
@@ -64,6 +64,13 @@ function Provider:new(bufnr)
end
---@package
+function Provider:destroy()
+ self:reset_timer()
+ api.nvim_del_augroup_by_id(self.augroup)
+ self.active[self.bufnr] = nil
+end
+
+---@package
---@param client_id integer
function Provider:on_attach(client_id)
local state = self.client_state[client_id]
diff --git a/runtime/lua/vim/lsp/inline_completion.lua b/runtime/lua/vim/lsp/inline_completion.lua
index 5b51d3388a..5804da42a7 100644
--- a/runtime/lua/vim/lsp/inline_completion.lua
+++ b/runtime/lua/vim/lsp/inline_completion.lua
@@ -92,6 +92,7 @@ end
---@package
function Completor:destroy()
+ self:reset_timer()
api.nvim_buf_clear_namespace(self.bufnr, namespace, 0, -1)
api.nvim_del_augroup_by_id(self.augroup)
self.active[self.bufnr] = nil