From 0072aa31ed1d3d441ec5cf4057286a9b27de78af Mon Sep 17 00:00:00 2001 From: veetaha Date: Tue, 24 Mar 2020 01:15:56 +0200 Subject: vscode: show release tag with along with the commit hash for RA version command --- editors/code/src/commands/server_version.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'editors') 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'; 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})` + ); }; } -- cgit v1.2.3 From 51156cbf030439525d4aa5182acd7e72a699c542 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Fri, 27 Mar 2020 11:05:37 +0200 Subject: vscode: fix release tag retrieval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- editors/code/src/commands/server_version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors') diff --git a/editors/code/src/commands/server_version.ts b/editors/code/src/commands/server_version.ts index 45fdefb12..d64ac726e 100644 --- a/editors/code/src/commands/server_version.ts +++ b/editors/code/src/commands/server_version.ts @@ -6,7 +6,7 @@ export function serverVersion(ctx: Ctx): Cmd { return async () => { const { stdout } = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" }); const commitHash = stdout.slice(`rust-analyzer `.length).trim(); - const { releaseTag } = ctx.config; + const { releaseTag } = ctx.config.package; void vscode.window.showInformationMessage( `rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})` -- cgit v1.2.3