mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
51156cbf03
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
16 lines
555 B
TypeScript
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})`
|
|
);
|
|
};
|
|
}
|