Skip to content

Commit 7283783

Browse files
bors[bot]matklad
andauthored
Merge #6094
6094: More panic_context r=matklad a=matklad bors r+\n🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents 4ecab09 + 8e34c0f commit 7283783

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/rust-analyzer/src/dispatch.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'a> RequestDispatcher<'a> {
2323
) -> Result<&mut Self>
2424
where
2525
R: lsp_types::request::Request + 'static,
26-
R::Params: DeserializeOwned + panic::UnwindSafe + 'static,
26+
R::Params: DeserializeOwned + panic::UnwindSafe + fmt::Debug + 'static,
2727
R::Result: Serialize + 'static,
2828
{
2929
let (id, params) = match self.parse::<R>() {
@@ -34,6 +34,7 @@ impl<'a> RequestDispatcher<'a> {
3434
};
3535
let world = panic::AssertUnwindSafe(&mut *self.global_state);
3636
let response = panic::catch_unwind(move || {
37+
stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params));
3738
let result = f(world.0, params);
3839
result_to_response::<R>(id, result)
3940
})
@@ -159,6 +160,7 @@ impl<'a> NotificationDispatcher<'a> {
159160
return Ok(self);
160161
}
161162
};
163+
stdx::panic_context::enter(format!("notification: {}", N::METHOD));
162164
f(self.global_state, params)?;
163165
Ok(self)
164166
}

0 commit comments

Comments
 (0)