diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2022-06-01 12:17:49 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2022-06-01 12:18:15 +0200 |
| commit | d88ae66ed9b5e5a33bd5121a4db4fa599e274170 (patch) | |
| tree | 099b6e02a48840b90dcd987179fe88152a020585 /crates/rust-analyzer/src/dispatch.rs | |
| parent | e2da967578872756b81d32665dc85a5d9fe54f9c (diff) | |
| download | rust-d88ae66ed9b5e5a33bd5121a4db4fa599e274170.tar.gz rust-d88ae66ed9b5e5a33bd5121a4db4fa599e274170.zip | |
Sync handlers cannot be cancelled
Diffstat (limited to 'crates/rust-analyzer/src/dispatch.rs')
| -rw-r--r-- | crates/rust-analyzer/src/dispatch.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/rust-analyzer/src/dispatch.rs b/crates/rust-analyzer/src/dispatch.rs index 8c74fcaeaf5..4d94630a564 100644 --- a/crates/rust-analyzer/src/dispatch.rs +++ b/crates/rust-analyzer/src/dispatch.rs @@ -51,10 +51,9 @@ impl<'a> RequestDispatcher<'a> { let _pctx = stdx::panic_context::enter(panic_context); f(self.global_state, params) }; - match result_to_response::<R>(req.id.clone(), result) { - Ok(response) => self.global_state.respond(response), - Err(_) => self.global_state.task_pool.handle.send_retry(req), - }; + if let Ok(response) = result_to_response::<R>(req.id.clone(), result) { + self.global_state.respond(response); + } self } @@ -80,10 +79,9 @@ impl<'a> RequestDispatcher<'a> { f(global_state_snapshot, params) }); - match thread_result_to_response::<R>(req.id.clone(), result) { - Ok(response) => self.global_state.respond(response), - Err(_) => self.global_state.task_pool.handle.send_retry(req), - }; + if let Ok(response) = thread_result_to_response::<R>(req.id.clone(), result) { + self.global_state.respond(response); + } self } |
