aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/server_version.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/commands/server_version.ts')
-rw-r--r--editors/code/src/commands/server_version.ts16
1 files changed, 3 insertions, 13 deletions
diff --git a/editors/code/src/commands/server_version.ts b/editors/code/src/commands/server_version.ts
index 83b1acf67..03528b825 100644
--- a/editors/code/src/commands/server_version.ts
+++ b/editors/code/src/commands/server_version.ts
@@ -1,20 +1,10 @@
1import * as vscode from 'vscode'; 1import * as vscode from "vscode";
2import { ensureServerBinary } from '../installation/server'; 2import { spawnSync } from "child_process";
3import { Ctx, Cmd } from '../ctx'; 3import { Ctx, Cmd } from '../ctx';
4import { spawnSync } from 'child_process';
5 4
6export function serverVersion(ctx: Ctx): Cmd { 5export function serverVersion(ctx: Ctx): Cmd {
7 return async () => { 6 return async () => {
8 const binaryPath = await ensureServerBinary(ctx.config, ctx.state); 7 const version = spawnSync(ctx.serverPath, ["--version"], { encoding: "utf8" }).stdout;
9
10 if (binaryPath == null) {
11 throw new Error(
12 "Rust Analyzer Language Server is not available. " +
13 "Please, ensure its [proper installation](https://rust-analyzer.github.io/manual.html#installation)."
14 );
15 }
16
17 const version = spawnSync(binaryPath, ["--version"], { encoding: "utf8" }).stdout;
18 vscode.window.showInformationMessage('rust-analyzer version : ' + version); 8 vscode.window.showInformationMessage('rust-analyzer version : ' + version);
19 }; 9 };
20} 10}