1 import * as vscode from 'vscode';
2 import { ensureServerBinary } from '../installation/server';
3 import { Ctx, Cmd } from '../ctx';
4 import { spawnSync } from 'child_process';
6 export function serverVersion(ctx: Ctx): Cmd {
8 const binaryPath = await ensureServerBinary(ctx.config);
10 if (binaryPath == null) {
12 "Rust Analyzer Language Server is not available. " +
13 "Please, ensure its [proper installation](https://rust-analyzer.github.io/manual.html#installation)."
17 const version = spawnSync(binaryPath, ["--version"], { encoding: "utf8" }).stdout;
18 vscode.window.showInformationMessage('rust-analyzer version : ' + version);