Skip to content

Commit

Permalink
Merge pull request #92 from olafurpg/proxy-instructions
Browse files Browse the repository at this point in the history
 Link to HTTP proxy instructions in "failed to download" error.

Co-authored-by: Gabriele Petronella <gabriele@buildo.io>
  • Loading branch information
gabro committed Apr 3, 2019
2 parents fc7e6d7 + 85e8e38 commit 66c13c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 an HTTP proxy.`;
if (process.env.FLATPAK_SANDBOX_DIR) {
return (
`Failed to download Metals. It seems you are running Visual Studio Code inside the` +
Expand All @@ -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
);
}
})();
Expand Down

0 comments on commit 66c13c3

Please sign in to comment.