From de9cc715fc365f2e08a665a432e464a064073996 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 2 Jan 2019 18:15:05 -0800 Subject: [PATCH] Give a better message if the binary is missing. (#2975) * Give a better message if the binary is missing. --- Extension/src/LanguageServer/client.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 1b0dbd1c7c..a4ba37098a 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -29,6 +29,7 @@ import { SettingsTracker, getTracker } from './settingsTracker'; import { getTestHook, TestHook } from '../testHook'; import { getCustomConfigProviders, CustomConfigurationProviderCollection, CustomConfigurationProvider1 } from '../LanguageServer/customProviders'; import { ABTestSettings, getABTestSettings } from '../abTesting'; +import * as fs from 'fs'; let ui: UI; const configProviderTimeout: number = 2000; @@ -353,6 +354,10 @@ class DefaultClient implements Client { private createLanguageClient(allClients: ClientCollection, workspaceFolder?: vscode.WorkspaceFolder): LanguageClient { let serverModule: string = getLanguageServerFileName(); + let exeExists: boolean = fs.existsSync(serverModule); + if (!exeExists) { + throw String('Missing binary at ' + serverModule); + } let serverName: string = this.getName(workspaceFolder); let serverOptions: ServerOptions = {