aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-09-29 19:46:36 +0100
committerAleksey Kladov <[email protected]>2020-09-29 19:49:48 +0100
commit8e34c0fb736837a766029613382a3bf295e1157f (patch)
tree3e533d158bb8954c46c5e1a7dcd4ba03ba044c0a /crates
parentd3a2b21a8c34c7b7eea0a001a1412992e3ed2cb7 (diff)
More panic_context
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/dispatch.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/dispatch.rs b/crates/rust-analyzer/src/dispatch.rs
index 36f0c1d52..9c8815e29 100644
--- a/crates/rust-analyzer/src/dispatch.rs
+++ b/crates/rust-analyzer/src/dispatch.rs
@@ -23,7 +23,7 @@ impl<'a> RequestDispatcher<'a> {
23 ) -> Result<&mut Self> 23 ) -> Result<&mut Self>
24 where 24 where
25 R: lsp_types::request::Request + 'static, 25 R: lsp_types::request::Request + 'static,
26 R::Params: DeserializeOwned + panic::UnwindSafe + 'static, 26 R::Params: DeserializeOwned + panic::UnwindSafe + fmt::Debug + 'static,
27 R::Result: Serialize + 'static, 27 R::Result: Serialize + 'static,
28 { 28 {
29 let (id, params) = match self.parse::<R>() { 29 let (id, params) = match self.parse::<R>() {
@@ -34,6 +34,7 @@ impl<'a> RequestDispatcher<'a> {
34 }; 34 };
35 let world = panic::AssertUnwindSafe(&mut *self.global_state); 35 let world = panic::AssertUnwindSafe(&mut *self.global_state);
36 let response = panic::catch_unwind(move || { 36 let response = panic::catch_unwind(move || {
37 stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params));
37 let result = f(world.0, params); 38 let result = f(world.0, params);
38 result_to_response::<R>(id, result) 39 result_to_response::<R>(id, result)
39 }) 40 })
@@ -159,6 +160,7 @@ impl<'a> NotificationDispatcher<'a> {
159 return Ok(self); 160 return Ok(self);
160 } 161 }
161 }; 162 };
163 stdx::panic_context::enter(format!("notification: {}", N::METHOD));
162 f(self.global_state, params)?; 164 f(self.global_state, params)?;
163 Ok(self) 165 Ok(self)
164 } 166 }