Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activation: extension crashes if go is not found #660

Closed
hyangah opened this issue Sep 18, 2020 · 2 comments
Closed

activation: extension crashes if go is not found #660

hyangah opened this issue Sep 18, 2020 · 2 comments

Comments

@hyangah
Copy link
Contributor

hyangah commented Sep 18, 2020

From #457 (comment)

The extension host crashed with the following trace.

[2020-09-18 15:50:29.097] [exthost] [error] Activating extension golang.go failed due to an error:
[2020-09-18 15:50:29.103] [exthost] [error] TypeError: Cannot read property 'then' of undefined
	at activate (/Users/aran/.vscode/extensions/golang.go-0.16.2/dist/goMain.js:13951:46)
	at Function._callActivateOptional (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:917:841)
	at Function._callActivate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:917:492)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:915:724
	at processTicksAndRejections (internal/process/task_queues.js:94:5)
	at async Promise.all (index 0)

The crash point corresponds to

updateGoVarsFromConfig().then(async () => {

I suspect, the user's vscode got launched with incomplete PATH after the reboot & clean restart,
so the extension failed to find the go. The extension is supposed to a notification popup to indicate
this issue, but it's not guaranteed that the popup would show up first before the extension crashes.

@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/255963 mentions this issue: src/goInstallTools.ts: return a rejected promise when go isn't found

@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/257603 mentions this issue: [release] src/goInstallTools.ts: return a rejected promise when go isn't found

gopherbot pushed a commit that referenced this issue Sep 28, 2020
…n't found

If Go is not found, return a rejected promise, so, the promise
chaining can work. updateGoVarsFromConfig is not declared as an
async, so returning nothing means returning nothing.

Fixes #660

Change-Id: I16f73ca057f3b6bb220a754afc1baa43cc891c22
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/255963
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
(cherry picked from commit 8e9cae7)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/257603
@golang golang locked and limited conversation to collaborators Sep 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants