From 0e202e9e3cf2fb36d2df2dfcf6f44552a0f54212 Mon Sep 17 00:00:00 2001 From: Yu Chen Hou Date: Mon, 16 Dec 2019 17:18:40 -0800 Subject: [PATCH] A more descriptive error message for remote HHVM (#84) * A more descriptive error message for remote HHVM Show a more descriptive error message if the connection to the remote ssh/docker HHVM server fails. * Update src/main.ts Co-Authored-By: Pranay Agarwal --- src/main.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 863eb9c..59bf052 100755 --- a/src/main.ts +++ b/src/main.ts @@ -15,10 +15,15 @@ export async function activate(context: vscode.ExtensionContext) { // check if a compatible verison of hh_client is installed, or show an error message and deactivate extension typecheck & intellisense features const version = await hh_client.version(); if (!version) { - vscode.window.showErrorMessage( - `Invalid hh_client executable: '${config.clientPath}'. Please ensure that HHVM is correctly installed or configure an alternate hh_client path in workspace settings.` - ); - return; + let errMsg = `Invalid hh_client executable: '${config.clientPath}'. Please ensure that HHVM is correctly installed or configure an alternate hh_client path in workspace settings.`; + + if (config.remoteEnabled && config.remoteType === 'ssh') { + errMsg = `Unable to connect to remote Hack server, please ensure it is running, and restart VSCode.`; + } else if (config.remoteEnabled && config.remoteType === 'docker') { + errMsg = `Unable to connect to the HHVM Docker container, please ensure the container and HHVM is running, and restart VSCode.`; + } + + vscode.window.showErrorMessage(errMsg); } const services: Promise[] = [];