aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorveetaha <[email protected]>2020-03-23 23:15:56 +0000
committerveetaha <[email protected]>2020-03-26 22:38:03 +0000
commit0072aa31ed1d3d441ec5cf4057286a9b27de78af (patch)
tree3fa42de30a3f488c40405daea0a1fb922f85135c
parentd2619bf0ca0c8c2ff8cda22beec9851887e4a4d5 (diff)
vscode: show release tag with along with the commit hash for RA version command
-rw-r--r--editors/code/src/commands/server_version.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/editors/code/src/commands/server_version.ts b/editors/code/src/commands/server_version.ts
index 03528b825..45fdefb12 100644
--- a/editors/code/src/commands/server_version.ts
+++ b/editors/code/src/commands/server_version.ts
@@ -4,7 +4,12 @@ import { Ctx, Cmd } from '../ctx';
4 4
5export function serverVersion(ctx: Ctx): Cmd { 5export function serverVersion(ctx: Ctx): Cmd {
6 return async () => { 6 return async () => {
7 const version = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" }).stdout; 7 const { stdout } = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" });
8 vscode.window.showInformationMessage('rust-analyzer version : ' + version); 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 );
9 }; 14 };
10} 15}