neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit d76f7fef13e534cce870cbce6b1bfaecd18bd034
parent 4fd2694f20d6abe4305e3f37ca06cf86762ad6a2
Author: Yi Ming <ofseed@foxmail.com>
Date:   Thu, 13 Feb 2025 11:51:31 +0800

fix(lsp): reset active request when reporting an error

Diffstat:
Mruntime/lua/vim/lsp/semantic_tokens.lua | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua @@ -294,9 +294,16 @@ function STHighlighter:send_request() local c = vim.lsp.get_client_by_id(ctx.client_id) local bufnr = assert(ctx.bufnr) local highlighter = STHighlighter.active[bufnr] - if not err and c and highlighter then - coroutine.wrap(STHighlighter.process_response)(highlighter, response, c, version) + if not (c and highlighter) then + return end + + if err then + highlighter.client_state[c.id].active_request = {} + return + end + + coroutine.wrap(STHighlighter.process_response)(highlighter, response, c, version) end, self.bufnr) if success then