Bring the version command output in line with other rust tools

This commit is contained in:
Lukas Wirth
2022-06-02 18:14:38 +02:00
parent 88024c7ec2
commit a2a3ea86ea
8 changed files with 105 additions and 66 deletions

View File

@@ -8,6 +8,7 @@ use serde::{de::DeserializeOwned, Serialize};
use crate::{
global_state::{GlobalState, GlobalStateSnapshot},
main_loop::Task,
version::version,
LspError, Result,
};
@@ -144,7 +145,7 @@ impl<'a> RequestDispatcher<'a> {
match res {
Ok(params) => {
let panic_context =
format!("\nversion: {}\nrequest: {} {:#?}", env!("REV"), R::METHOD, params);
format!("\nversion: {}\nrequest: {} {:#?}", version(), R::METHOD, params);
Some((req, params, panic_context))
}
Err(err) => {
@@ -248,7 +249,7 @@ impl<'a> NotificationDispatcher<'a> {
};
let _pctx = stdx::panic_context::enter(format!(
"\nversion: {}\nnotification: {}",
env!("REV"),
version(),
N::METHOD
));
f(self.global_state, params)?;