mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
15 lines
547 B
TypeScript
15 lines
547 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;
|
|
|
|
void vscode.window.showInformationMessage(
|
|
`rust-analyzer version: ${releaseTag ?? "unreleased"} (${commitHash})`
|
|
);
|
|
};
|
|
}
|