src/goInstallTools: add reference for incorrect PATH issue
When VSCode fails to load the login shell environment
within a hard-coded time limit, VSCode starts the extension
without complete PATH environment. As a result, the Go
extension fails to find go.
Until VSCode finds a way to address the issue, provide
users the link to the issue - so they can quickly find
the temporary workaround ('Reload the window').
Fixes golang/vscode-go#971
Change-Id: I94a1291f24a5a53edfcdf6c8e62b468f91396268
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/276492
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Trust: Suzy Mueller <suzmue@golang.org>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
diff --git a/src/goInstallTools.ts b/src/goInstallTools.ts
index 05ebc4f..5c64e84 100644
--- a/src/goInstallTools.ts
+++ b/src/goInstallTools.ts
@@ -514,18 +514,15 @@
let suggestedDownloadGo = false;
async function suggestDownloadGo() {
+ const msg = `Failed to find the "go" binary in either GOROOT(${getCurrentGoRoot()}) or PATH(${envPath}).` +
+ `Check PATH, or Install Go and reload the window. ` +
+ `If PATH isn't what you expected, see https://github.com/golang/vscode-go/issues/971`;
if (suggestedDownloadGo) {
- vscode.window.showErrorMessage(
- `Failed to find the "go" binary in either GOROOT(${getCurrentGoRoot()}) or PATH(${envPath}).`
- );
+ vscode.window.showErrorMessage(msg);
return;
}
- const choice = await vscode.window.showErrorMessage(
- `Failed to find the "go" binary in either GOROOT(${getCurrentGoRoot()}) or PATH(${envPath}). ` +
- `Check PATH, or Install Go and reload the window.`,
- 'Go to Download Page'
- );
+ const choice = await vscode.window.showErrorMessage(msg, 'Go to Download Page');
if (choice === 'Go to Download Page') {
vscode.env.openExternal(vscode.Uri.parse('https://golang.org/dl/'));
}