Skip to content

Commit 6aa18de

Browse files
bors[bot]Veetaha
andauthored
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>
2 parents d2619bf + 51156cb commit 6aa18de

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

editors/code/src/commands/server_version.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import { Ctx, Cmd } from '../ctx';
44

55
export function serverVersion(ctx: Ctx): Cmd {
66
return async () => {
7-
const version = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" }).stdout;
8-
vscode.window.showInformationMessage('rust-analyzer version : ' + version);
7+
const { stdout } = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" });
8+
const commitHash = stdout.slice(`rust-analyzer `.length).trim();
9+
const { releaseTag } = ctx.config.package;
10+
11+
void vscode.window.showInformationMessage(
12+
`rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})`
13+
);
914
};
1015
}

0 commit comments

Comments
 (0)