From b9c17a6001aaf79e181a86218883fe96d9c95c09 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 9 Dec 2018 14:43:02 +0300 Subject: Answer canceled requests --- crates/ra_lsp_server/src/main_loop.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index a01eeff88..41f70f263 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -318,7 +318,14 @@ fn on_notification( panic!("string id's not supported: {:?}", id); } }; - pending_requests.remove(&id); + if pending_requests.remove(&id) { + let response = RawResponse::err( + id, + ErrorCode::RequestCancelled as i32, + "canceled by client".to_string(), + ); + msg_sender.send(RawMessage::Response(response)) + } return Ok(()); } Err(not) => not, -- cgit v1.2.3