mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
vscode: show release tag with along with the commit hash for RA version command
This commit is contained in:
parent
d2619bf0ca
commit
0072aa31ed
1 changed files with 7 additions and 2 deletions
|
@ -4,7 +4,12 @@ import { Ctx, Cmd } from '../ctx';
|
||||||
|
|
||||||
export function serverVersion(ctx: Ctx): Cmd {
|
export function serverVersion(ctx: Ctx): Cmd {
|
||||||
return async () => {
|
return async () => {
|
||||||
const version = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" }).stdout;
|
const { stdout } = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" });
|
||||||
vscode.window.showInformationMessage('rust-analyzer version : ' + version);
|
const commitHash = stdout.slice(`rust-analyzer `.length).trim();
|
||||||
|
const { releaseTag } = ctx.config;
|
||||||
|
|
||||||
|
void vscode.window.showInformationMessage(
|
||||||
|
`rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})`
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue