diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-08 12:14:24 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-08 12:14:24 +0100 |
commit | 4e3f0186d87e1be85bdc1e0bc3074147715e46c3 (patch) | |
tree | 7b8836ce4318cae86e4a012c4fc716cfc3ab33b5 /crates | |
parent | d43b3bfecbc0fe2ed37a93faf58906e08da6b9e8 (diff) | |
parent | f015429c82c2d09a66102e8a21a9553a4fe85cf1 (diff) |
Merge #8764
8764: internal: add rust-analyzer version to panic context r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/dispatch.rs | 21 |
1 files changed, 17 insertions, 4 deletions
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> { | |||
33 | let world = panic::AssertUnwindSafe(&mut *self.global_state); | 33 | let world = panic::AssertUnwindSafe(&mut *self.global_state); |
34 | 34 | ||
35 | let response = panic::catch_unwind(move || { | 35 | let response = panic::catch_unwind(move || { |
36 | let _pctx = stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params)); | 36 | let _pctx = stdx::panic_context::enter(format!( |
37 | "\nversion: {}\nrequest: {} {:#?}", | ||
38 | env!("REV"), | ||
39 | R::METHOD, | ||
40 | params | ||
41 | )); | ||
37 | let result = f(world.0, params); | 42 | let result = f(world.0, params); |
38 | result_to_response::<R>(id, result) | 43 | result_to_response::<R>(id, result) |
39 | }) | 44 | }) |
@@ -61,8 +66,12 @@ impl<'a> RequestDispatcher<'a> { | |||
61 | let world = self.global_state.snapshot(); | 66 | let world = self.global_state.snapshot(); |
62 | 67 | ||
63 | move || { | 68 | move || { |
64 | let _pctx = | 69 | let _pctx = stdx::panic_context::enter(format!( |
65 | stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params)); | 70 | "\nversion: {}\nrequest: {} {:#?}", |
71 | env!("REV"), | ||
72 | R::METHOD, | ||
73 | params | ||
74 | )); | ||
66 | let result = f(world, params); | 75 | let result = f(world, params); |
67 | Task::Response(result_to_response::<R>(id, result)) | 76 | Task::Response(result_to_response::<R>(id, result)) |
68 | } | 77 | } |
@@ -166,7 +175,11 @@ impl<'a> NotificationDispatcher<'a> { | |||
166 | return Ok(self); | 175 | return Ok(self); |
167 | } | 176 | } |
168 | }; | 177 | }; |
169 | let _pctx = stdx::panic_context::enter(format!("notification: {}", N::METHOD)); | 178 | let _pctx = stdx::panic_context::enter(format!( |
179 | "\nversion: {}\nnotification: {}", | ||
180 | env!("REV"), | ||
181 | N::METHOD | ||
182 | )); | ||
170 | f(self.global_state, params)?; | 183 | f(self.global_state, params)?; |
171 | Ok(self) | 184 | Ok(self) |
172 | } | 185 | } |