Improve version display
This commit is contained in:
parent
c0459c5357
commit
88ef0541a5
@ -39,8 +39,7 @@ fn set_rerun() {
|
||||
}
|
||||
|
||||
fn rev() -> Option<String> {
|
||||
let output = Command::new("git").args(&["rev-parse", "HEAD"]).output().ok()?;
|
||||
let output = Command::new("git").args(&["describe", "--tags"]).output().ok()?;
|
||||
let stdout = String::from_utf8(output.stdout).ok()?;
|
||||
let short_hash = stdout.get(0..7)?;
|
||||
Some(short_hash.to_owned())
|
||||
Some(stdout)
|
||||
}
|
||||
|
@ -253,11 +253,10 @@ export function ssr(ctx: Ctx): Cmd {
|
||||
export function serverVersion(ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
const { stdout } = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" });
|
||||
const commitHash = stdout.slice(`rust-analyzer `.length).trim();
|
||||
const { releaseTag } = ctx.config.package;
|
||||
const versionString = stdout.slice(`rust-analyzer `.length).trim();
|
||||
|
||||
void vscode.window.showInformationMessage(
|
||||
`rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})`
|
||||
`rust-analyzer version: ${versionString}`
|
||||
);
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user