From 695b8ba0f069605836f13cedae194c50df6c10ed Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 31 Dec 2019 20:54:31 +0100 Subject: Sanity check for missing server binary --- editors/code/src/client.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'editors') diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 743384bd7..1ff64a930 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -1,5 +1,6 @@ import { homedir } from 'os'; import * as lc from 'vscode-languageclient'; +import { spawnSync } from 'child_process'; import { window, workspace } from 'vscode'; import { Config } from './config'; @@ -13,6 +14,9 @@ export function createClient(config: Config): lc.LanguageClient { } const command = expandPathResolving(config.raLspServerPath); + if (spawnSync(command, ["--version"]).status !== 0) { + window.showErrorMessage(`Unable to execute '${command} --version'`); + } const run: lc.Executable = { command, options: { cwd: folder }, -- cgit v1.2.3