diff --git a/crates/rust-analyzer/src/dispatch.rs b/crates/rust-analyzer/src/dispatch.rs index 36f0c1d520e..9c8815e29e8 100644 --- a/crates/rust-analyzer/src/dispatch.rs +++ b/crates/rust-analyzer/src/dispatch.rs @@ -23,7 +23,7 @@ pub(crate) fn on_sync( ) -> 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 @@ pub(crate) fn on_sync( }; 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 @@ pub(crate) fn on( return Ok(self); } }; + stdx::panic_context::enter(format!("notification: {}", N::METHOD)); f(self.global_state, params)?; Ok(self) }