mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +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:
		 Andre Toerien
					Andre Toerien
				
			
				
					committed by
					
						![github-actions[bot]](/assets/img/avatar_default.png) github-actions[bot]
						github-actions[bot]
					
				
			
			
				
	
			
			
			![github-actions[bot]](/assets/img/avatar_default.png) github-actions[bot]
						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