diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 46fa481109..e1f97c7787 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -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