From 8e34c0fb736837a766029613382a3bf295e1157f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 29 Sep 2020 20:46:36 +0200 Subject: More panic_context --- crates/rust-analyzer/src/dispatch.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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> { ) -> Result<&mut Self> where R: lsp_types::request::Request + 'static, - R::Params: DeserializeOwned + panic::UnwindSafe + 'static, + R::Params: DeserializeOwned + panic::UnwindSafe + fmt::Debug + 'static, R::Result: Serialize + 'static, { let (id, params) = match self.parse::() { @@ -34,6 +34,7 @@ impl<'a> RequestDispatcher<'a> { }; let world = panic::AssertUnwindSafe(&mut *self.global_state); let response = panic::catch_unwind(move || { + stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params)); let result = f(world.0, params); result_to_response::(id, result) }) @@ -159,6 +160,7 @@ impl<'a> NotificationDispatcher<'a> { return Ok(self); } }; + stdx::panic_context::enter(format!("notification: {}", N::METHOD)); f(self.global_state, params)?; Ok(self) } -- cgit v1.2.3