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

x/tools/gopls: vscode: uninitialized settings in multi-root workspace #1746

Open
Michael-F-Ellis opened this issue Sep 1, 2021 · 3 comments
Open

Comments

@Michael-F-Ellis
Copy link

@Michael-F-Ellis Michael-F-Ellis commented Sep 1, 2021

Summary

In a multi-root workspace containing folders with code that must be built with different GOOS & GOARCH, the folder's settings.json is initially ignored the first time one of the files in the folder is opened for editing. In the case of js,wasm this results in a cascade of error messages stemming from the inability to import syscall.js.

The errors can generally be resolved by Developer Reload Window.

I created a minimal repo that can be used to reproduce the problem at https://github.com/Michael-F-Ellis/wasmvetissue

I don't know if this is a gopls issue or a vscode issue, so I'm submitting it in both repositories.

What version of Go are you using (go version)?

$ go version
go version go1.16 darwin/amd64

Does this issue reproduce with the latest release?

Unknown

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOOS="darwin"
but note that the problem I'm describing manifests in a workspace configured for js,wasm.

What did you do?

Clone the repository from the link I provided above. Open it in vscode by opening its workspace.code-workspace. In vscode, open wasm/main.go.

What did you expect to see?

No errors reported.

What did you see instead?

Four errors total beginning with a failure to import syscall.js accompanied by a message about build constraints.

The errors disappear if you then execute Developer Reload Window.

The behavior is dependent on the initial state of the workspace, i.e. if you quit vscode with one of the files in the wasm folder opened for editing, the problem does not recur the next time you open the workspace. OTOH, if you quit with a file from the notwasm folder opened, the problem will recur.

@findleyr
Copy link
Contributor

@findleyr findleyr commented Sep 1, 2021

Thanks for reporting, and for the repro.

This doesn't sound directly related to gopls, but rather is vscode specifig. Transferring to the vscode-go repo.

@findleyr findleyr transferred this issue from golang/go Sep 1, 2021
@gopherbot gopherbot added this to the Untriaged milestone Sep 1, 2021
@findleyr
Copy link
Contributor

@findleyr findleyr commented Sep 2, 2021

@Michael-F-Ellis would you be able to grab gopls logs from a session that reproduces the issue? That will help us understand the exchange of settings between vs code and gopls.

Instructions for how to do this can be found here:
https://github.com/golang/vscode-go/blob/master/docs/troubleshooting.md#collect-gopls-information

@Michael-F-Ellis
Copy link
Author

@Michael-F-Ellis Michael-F-Ellis commented Sep 2, 2021

@Michael-F-Ellis would you be able to grab gopls logs from a session that reproduces the issue? That will help us understand the exchange of settings between vs code and gopls.

Sure, might be a day or so before I can make time for it.

@stamblerre stamblerre removed this from the Untriaged milestone Sep 9, 2021
@stamblerre stamblerre added this to the Backlog milestone Sep 9, 2021
@stamblerre stamblerre changed the title x/tools/gopls: vscode: Uninitialized settings in multi-root workspace x/tools/gopls: vscode: uninitialized settings in multi-root workspace Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants