mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
Merge #3693
3693: vscode: show release tag with along with the commit hash for RA version command r=matklad a=Veetaha Co-authored-by: veetaha <veetaha2@gmail.com> Co-authored-by: Veetaha <veetaha2@gmail.com>
This commit is contained in:
@@ -4,7 +4,12 @@ import { Ctx, Cmd } from '../ctx';
|
||||
|
||||
export function serverVersion(ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
const version = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" }).stdout;
|
||||
vscode.window.showInformationMessage('rust-analyzer version : ' + version);
|
||||
const { stdout } = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" });
|
||||
const commitHash = stdout.slice(`rust-analyzer `.length).trim();
|
||||
const { releaseTag } = ctx.config.package;
|
||||
|
||||
void vscode.window.showInformationMessage(
|
||||
`rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})`
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user