aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-09-29 19:50:46 +0100
committerGitHub <[email protected]>2020-09-29 19:50:46 +0100
commit7283783b98ed61ee4f94961b81ad06e2344098d2 (patch)
tree3e533d158bb8954c46c5e1a7dcd4ba03ba044c0a
parent4ecab09cbc835976efe6e64780bffdec99562ddb (diff)
parent8e34c0fb736837a766029613382a3bf295e1157f (diff)
Merge #6094
6094: More panic_context r=matklad a=matklad bors r+\n🤖 Co-authored-by: Aleksey Kladov <[email protected]>
-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 }