Files
rust/editors/code/src/commands/server_version.ts
Veetaha 51156cbf03 vscode: fix release tag retrieval
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-03-27 11:05:37 +02:00

16 lines
555 B
TypeScript

import * as vscode from "vscode";
import { spawnSync } from "child_process";
import { Ctx, Cmd } from '../ctx';
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.package;
void vscode.window.showInformationMessage(
`rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})`
);
};
}