From d382e90f4105f42b6a8c1f500eb47763eb2b0d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Tue, 2 Apr 2019 11:25:30 +0200 Subject: [PATCH 1/2] Link to HTTP proxy instructions in "failed to download" error. Fixes #84. Previously, the download error message only said "make sure you have an internet connection" when the most common cause for this problem was HTTP proxies. Now, the error message links to the Metals website for how to configure HTTP proxies. --- src/extension.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 83b708c06..a81a1dedb 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -141,6 +141,9 @@ function fetchAndLaunchMetals(context: ExtensionContext, javaHome: string) { }, () => { const msg = (() => { + const proxy = + `See https://scalameta.org/metals/docs/editors/vscode.html#http-proxy for instructions ` + + `if you are using a corporate HTTP proxy.`; if (process.env.FLATPAK_SANDBOX_DIR) { return ( `Failed to download Metals. It seems you are running Visual Studio Code inside the` + @@ -150,13 +153,15 @@ function fetchAndLaunchMetals(context: ExtensionContext, javaHome: string) { } else if (serverVersion === defaultServerVersion) { return ( `Failed to download Metals, make sure you have an internet connection and` + - `the Java Home '${javaPath}' is valid. You can configure the Java Home in the settings.` + `the Java Home '${javaPath}' is valid. You can configure the Java Home in the settings.` + + proxy ); } else { return ( `Failed to download Metals, make sure you have an internet connection, ` + `the Metals version '${serverVersion}' is correct and the Java Home '${javaPath}' is valid. ` + - `You can configure the Metals version and Java Home in the settings.` + `You can configure the Metals version and Java Home in the settings.` + + proxy ); } })(); From 85e8e38808556633333feb834de9e1ecf099dd6c Mon Sep 17 00:00:00 2001 From: Gabriele Petronella Date: Wed, 3 Apr 2019 15:03:11 +0200 Subject: [PATCH 2/2] Update src/extension.ts Co-Authored-By: olafurpg --- src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index a81a1dedb..d1c530af5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -143,7 +143,7 @@ function fetchAndLaunchMetals(context: ExtensionContext, javaHome: string) { const msg = (() => { const proxy = `See https://scalameta.org/metals/docs/editors/vscode.html#http-proxy for instructions ` + - `if you are using a corporate HTTP proxy.`; + `if you are using an HTTP proxy.`; if (process.env.FLATPAK_SANDBOX_DIR) { return ( `Failed to download Metals. It seems you are running Visual Studio Code inside the` +