vscode: show release tag with along with the commit hash for RA version command
@@ -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;
+
+ void vscode.window.showInformationMessage(
+ `rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})`
+ );
};
}
