From f015429c82c2d09a66102e8a21a9553a4fe85cf1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 8 May 2021 14:03:12 +0300 Subject: internal: add rust-analyzer version to panic context --- crates/rust-analyzer/src/dispatch.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/dispatch.rs b/crates/rust-analyzer/src/dispatch.rs index 81b85a269..baf2199d9 100644 --- a/crates/rust-analyzer/src/dispatch.rs +++ b/crates/rust-analyzer/src/dispatch.rs @@ -33,7 +33,12 @@ impl<'a> RequestDispatcher<'a> { let world = panic::AssertUnwindSafe(&mut *self.global_state); let response = panic::catch_unwind(move || { - let _pctx = stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params)); + let _pctx = stdx::panic_context::enter(format!( + "\nversion: {}\nrequest: {} {:#?}", + env!("REV"), + R::METHOD, + params + )); let result = f(world.0, params); result_to_response::(id, result) }) @@ -61,8 +66,12 @@ impl<'a> RequestDispatcher<'a> { let world = self.global_state.snapshot(); move || { - let _pctx = - stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params)); + let _pctx = stdx::panic_context::enter(format!( + "\nversion: {}\nrequest: {} {:#?}", + env!("REV"), + R::METHOD, + params + )); let result = f(world, params); Task::Response(result_to_response::(id, result)) } @@ -166,7 +175,11 @@ impl<'a> NotificationDispatcher<'a> { return Ok(self); } }; - let _pctx = stdx::panic_context::enter(format!("notification: {}", N::METHOD)); + let _pctx = stdx::panic_context::enter(format!( + "\nversion: {}\nnotification: {}", + env!("REV"), + N::METHOD + )); f(self.global_state, params)?; Ok(self) } -- cgit v1.2.3