mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
fix(lsp): _cancel_all_requests() tries to cancel completed requests #34105
Problem:
The cancel function returned by `vim.lsp.buf_request` tries to cancel
all the requests, including those that have already been completed,
causing "Cannot find request with id ... whilst attempting to cancel"
errors to be logged when it is called.
Solution:
Only cancel the requests that are present in `client.requests`.
(cherry picked from commit a9b8a8dc6c
)
This commit is contained in:
committed by
github-actions[bot]
parent
ec84c8df0e
commit
d0a24ea03e
@ -1288,7 +1288,9 @@ function lsp.buf_request(bufnr, method, params, handler, on_unsupported)
|
||||
local function _cancel_all_requests()
|
||||
for client_id, request_id in pairs(client_request_ids) do
|
||||
local client = all_clients[client_id]
|
||||
client:cancel_request(request_id)
|
||||
if client.requests[request_id] then
|
||||
client:cancel_request(request_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user