about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-09-29 20:46:36 +0200
committerAleksey Kladov <aleksey.kladov@gmail.com>2020-09-29 20:49:48 +0200
commit8e34c0fb736837a766029613382a3bf295e1157f (patch)
tree3e533d158bb8954c46c5e1a7dcd4ba03ba044c0a
parentd3a2b21a8c34c7b7eea0a001a1412992e3ed2cb7 (diff)
downloadrust-8e34c0fb736837a766029613382a3bf295e1157f.tar.gz
rust-8e34c0fb736837a766029613382a3bf295e1157f.zip
More panic_context
-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 36f0c1d520e..9c8815e29e8 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::<R>() {
@@ -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::<R>(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)
     }