Merge #6094
6094: More panic_context r=matklad a=matklad
bors r+\n🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
7283783b98
@ -23,7 +23,7 @@ pub(crate) fn on_sync<R>(
|
||||
) -> 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 @@ pub(crate) fn on_sync<R>(
|
||||
};
|
||||
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 @@ pub(crate) fn on<N>(
|
||||
return Ok(self);
|
||||
}
|
||||
};
|
||||
stdx::panic_context::enter(format!("notification: {}", N::METHOD));
|
||||
f(self.global_state, params)?;
|
||||
Ok(self)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user