Skip to content

Commit 0072aa3

Browse files
committed
vscode: show release tag with along with the commit hash for RA version command
1 parent d2619bf commit 0072aa3

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;
10+
11+
void vscode.window.showInformationMessage(
12+
`rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})`
13+
);
914
};
1015
}

0 commit comments

Comments
 (0)