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 · 6 comments
Open
Assignees

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

@findleyr findleyr added the WaitingForInfo label Sep 2, 2021
@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
@hyangah
Copy link
Contributor

@hyangah hyangah commented Oct 29, 2021

I see both vscode-go and gopls issues. @findleyr

VS Code Go issue

  • vscode-go extension does not pass go.toolsEnvVars to gopls. So, in order to tell gopls to use different GOOS/GOARCH for the folder, I think currently wasm/.vscode/settings.json needs to be
{
	"go.toolsEnvVars": {
		"GOOS": "js",
		"GOARCH": "wasm",
	},
	"gopls": {
		"build.env": {
			"GOOS": "js",
			"GOARCH": "wasm",
		}
	}
}

Maybe we should consider do extra plumbing work like what's done for go.buildFlags.

Gopls issue

  • After setting the "gopls": "build.env": ... section, I see vscode responding with the expected "build.env" settings. But, gopls doesn't seem to respect them (I don't know why - does gopls understand these GOOS, GOARCH env vars? They are missing from the go env for ... log messages.
[Trace - 11:03:27.127 AM] Received request 'workspace/configuration - (4)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/ww/wasmvetissue/wasm","section":"gopls"}]}


[Trace - 11:03:27.186 AM] Sending response 'workspace/configuration - (4)' in 58ms.
Result: [{"build.env":{"GOOS":"js","GOARCH":"wasm"}}]

Full gopls log after changing the settings.json like above
[Trace - 11:03:26.712 AM] Sending request 'initialize - (0)'.
Params: {"processId":14645,"clientInfo":{"name":"Visual Studio Code","version":"1.61.2"},"locale":"en-us","rootPath":"/Users/hakim/ww/wasmvetissue/notwasm","rootUri":"file:///Users/hakim/ww/wasmvetissue/notwasm","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false},"linkedEditingRange":{"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"}}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///Users/hakim/ww/wasmvetissue/notwasm","name":"notwasm"},{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm","name":"wasm"}]}

[Trace - 11:03:26.714 AM] Received response 'initialize - (0)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."],"completionItem":{}},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.apply_fix","gopls.check_upgrades","gopls.gc_details","gopls.generate","gopls.generate_gopls_mod","gopls.go_get_package","gopls.list_known_packages","gopls.regenerate_cgo","gopls.remove_dependency","gopls.run_tests","gopls.start_debugging","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor","gopls.workspace_metadata"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"{"path":"golang.org/x/tools/gopls","version":"v0.7.3","sum":"h1:Lru57ht8vtDMouRskFC085VAjBAZRAISd/lwvwOOV0Q=","deps":[{"path":"github.com/BurntSushi/toml","version":"v0.3.1","sum":"h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ="},{"path":"github.com/google/go-cmp","version":"v0.5.6","sum":"h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ="},{"path":"github.com/sergi/go-diff","version":"v1.1.0","sum":"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0="},{"path":"golang.org/x/mod","version":"v0.4.2","sum":"h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo="},{"path":"golang.org/x/sync","version":"v0.0.0-20210220032951-036812b2e83c","sum":"h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ="},{"path":"golang.org/x/sys","version":"v0.0.0-20210809222454-d867a43fc93e","sum":"h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA="},{"path":"golang.org/x/text","version":"v0.3.6","sum":"h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M="},{"path":"golang.org/x/tools","version":"v0.1.8-0.20211014194737-fc98fb2abd48","sum":"h1:hk7xRoeg0CG1nRLsd5BZLDUgVpA9bnKylGk1p2/BPH0="},{"path":"golang.org/x/xerrors","version":"v0.0.0-20200804184101-5ec99f83aff1","sum":"h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE="},{"path":"honnef.co/go/tools","version":"v0.2.0","sum":"h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE="},{"path":"mvdan.cc/gofumpt","version":"v0.1.1","sum":"h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA="},{"path":"mvdan.cc/xurls/v2","version":"v2.3.0","sum":"h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I="}]}"}}

[Trace - 11:03:26.993 AM] Sending notification 'initialized'.
Params: {}

[Trace - 11:03:26.993 AM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"5577006791947779410"}

[Trace - 11:03:27.005 AM] Sending response 'window/workDoneProgress/create - (1)' in 11ms.
Result:

[Trace - 11:03:27.005 AM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}

[Trace - 11:03:27.005 AM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/ww/wasmvetissue/notwasm","section":"gopls"}]}

[Trace - 11:03:27.010 AM] Sending response 'workspace/configuration - (2)' in 5ms.
Result: [{}]

[Trace - 11:03:27.063 AM] Received request 'window/workDoneProgress/create - (3)'.
Params: {"token":"8674665223082153551"}

[Trace - 11:03:27.064 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:27 go env for /Users/hakim/ww/wasmvetissue/notwasm\n(root /Users/hakim/ww/wasmvetissue)\n(go version go version go1.17.2 darwin/amd64)\n(valid build configuration = true)\n(build flags: [])\nGONOSUMDB=\nGOMODCACHE=/Users/hakim/go/pkg/mod\nGOPROXY=https://proxy.golang.org,direct\nGOFLAGS=\nGOPRIVATE=\nGOSUMDB=sum.golang.org\nGONOPROXY=\nGO111MODULE=\nGOINSECURE=\nGOMOD=/Users/hakim/ww/wasmvetissue/go.mod\nGOCACHE=/Users/hakim/Library/Caches/go-build\nGOPATH=/Users/hakim/go\nGOROOT=/usr/local/Cellar/go/1.17.2/libexec\n\n"}

[Info - 11:03:27 AM] 2021/10/29 11:03:27 go env for /Users/hakim/ww/wasmvetissue/notwasm
(root /Users/hakim/ww/wasmvetissue)
(go version go version go1.17.2 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GONOSUMDB=
GOMODCACHE=/Users/hakim/go/pkg/mod
GOPROXY=https://proxy.golang.org,direct
GOFLAGS=
GOPRIVATE=
GOSUMDB=sum.golang.org
GONOPROXY=
GO111MODULE=
GOINSECURE=
GOMOD=/Users/hakim/ww/wasmvetissue/go.mod
GOCACHE=/Users/hakim/Library/Caches/go-build
GOPATH=/Users/hakim/go
GOROOT=/usr/local/Cellar/go/1.17.2/libexec

[Trace - 11:03:27.127 AM] Sending response 'window/workDoneProgress/create - (3)' in 63ms.
Result:

[Trace - 11:03:27.127 AM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}

[Trace - 11:03:27.127 AM] Received request 'workspace/configuration - (4)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/ww/wasmvetissue/wasm","section":"gopls"}]}

[Trace - 11:03:27.186 AM] Sending response 'workspace/configuration - (4)' in 58ms.
Result: [{"build.env":{"GOOS":"js","GOARCH":"wasm"}}]

[Trace - 11:03:27.243 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:27 go env for /Users/hakim/ww/wasmvetissue/wasm\n(root /Users/hakim/ww/wasmvetissue)\n(go version go version go1.17.2 darwin/amd64)\n(valid build configuration = true)\n(build flags: [])\nGOSUMDB=sum.golang.org\nGOINSECURE=\nGO111MODULE=\nGONOPROXY=\nGOROOT=/usr/local/Cellar/go/1.17.2/libexec\nGOPATH=/Users/hakim/go\nGOPRIVATE=\nGOMODCACHE=/Users/hakim/go/pkg/mod\nGONOSUMDB=\nGOMOD=/Users/hakim/ww/wasmvetissue/go.mod\nGOPROXY=https://proxy.golang.org,direct\nGOCACHE=/Users/hakim/Library/Caches/go-build\nGOFLAGS=\n\n"}

[Info - 11:03:27 AM] 2021/10/29 11:03:27 go env for /Users/hakim/ww/wasmvetissue/wasm
(root /Users/hakim/ww/wasmvetissue)
(go version go version go1.17.2 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GOSUMDB=sum.golang.org
GOINSECURE=
GO111MODULE=
GONOPROXY=
GOROOT=/usr/local/Cellar/go/1.17.2/libexec
GOPATH=/Users/hakim/go
GOPRIVATE=
GOMODCACHE=/Users/hakim/go/pkg/mod
GONOSUMDB=
GOMOD=/Users/hakim/ww/wasmvetissue/go.mod
GOPROXY=https://proxy.golang.org,direct
GOCACHE=/Users/hakim/Library/Caches/go-build
GOFLAGS=

[Trace - 11:03:27.393 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:27 go/packages.Load\n\tsnapshot=0\n\tdirectory=/Users/hakim/ww/wasmvetissue\n\tquery=[builtin github.com/Michael-F-Ellis/wasmvetissue/...]\n\tpackages=3\n"}

[Info - 11:03:27 AM] 2021/10/29 11:03:27 go/packages.Load
snapshot=0
directory=/Users/hakim/ww/wasmvetissue
query=[builtin github.com/Michael-F-Ellis/wasmvetissue/...]
packages=3

[Trace - 11:03:27.469 AM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"end","message":"Finished loading packages."}}

[Trace - 11:03:27.527 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:27 go/packages.Load\n\tsnapshot=0\n\tdirectory=/Users/hakim/ww/wasmvetissue\n\tquery=[builtin github.com/Michael-F-Ellis/wasmvetissue/...]\n\tpackages=4\n"}

[Info - 11:03:27 AM] 2021/10/29 11:03:27 go/packages.Load
snapshot=0
directory=/Users/hakim/ww/wasmvetissue
query=[builtin github.com/Michael-F-Ellis/wasmvetissue/...]
packages=4

[Trace - 11:03:27.549 AM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"end","message":"Finished loading packages."}}

[Trace - 11:03:27.549 AM] Received request 'client/registerCapability - (5)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/Users/hakim/ww/wasmvetissue//*.{go,mod,sum,work,tmpl}","kind":7},{"globPattern":"{/Users/hakim/ww/wasmvetissue/notwasm}","kind":7},{"globPattern":"/*.tmpl","kind":7},{"globPattern":"**/.{go,mod,sum,work,tmpl}","kind":7},{"globPattern":"{/Users/hakim/ww/wasmvetissue/notwasm,/Users/hakim/ww/wasmvetissue/wasm}","kind":7}]}}]}

[Trace - 11:03:27.554 AM] Sending response 'client/registerCapability - (5)' in 4ms.
Result:

[Trace - 11:03:27.554 AM] Received request 'client/registerCapability - (6)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"}]}

[Trace - 11:03:27.555 AM] Sending response 'client/registerCapability - (6)' in 0ms.
Result:

[Trace - 11:03:27.659 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:27 discovered missing identifiers: map[memRecordCycle:true pageBits:true]\n\tpackage="runtime"\n"}

[Info - 11:03:27 AM] 2021/10/29 11:03:27 discovered missing identifiers: map[memRecordCycle:true pageBits:true]
package="runtime"

[Trace - 11:03:28.017 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:28 discovered missing identifiers: map[memRecordCycle:true pageBits:true]\n\tpackage="runtime"\n"}

[Info - 11:03:28 AM] 2021/10/29 11:03:28 discovered missing identifiers: map[memRecordCycle:true pageBits:true]
package="runtime"

[Trace - 11:03:32.550 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go","languageId":"go","version":1,"text":"// +build js,wasm\n\npackage main\n\nimport "syscall/js"\n\nvar SP = &State{}\n\nfunc main() {\n\tjs.Global().Set("Foo", 1)\n\tUpdate()\n}\n\nfunc SetA(n int) {\n\tSP.A = n\n}\n"}}

[Trace - 11:03:32.550 AM] Sending request 'textDocument/documentLink - (1)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:03:32.550 AM] Sending request 'textDocument/codeAction - (2)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}

[Trace - 11:03:32.551 AM] Sending request 'textDocument/documentSymbol - (3)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:03:32.771 AM] Sending request 'textDocument/codeLens - (4)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:03:32.784 AM] Sending request 'textDocument/codeAction - (5)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"},"range":{"start":{"line":15,"character":1},"end":{"line":15,"character":1}},"context":{"diagnostics":[]}}

[Trace - 11:03:32.785 AM] Sending notification '$/cancelRequest'.
Params: {"id":2}

[Trace - 11:03:32.960 AM] Sending request 'textDocument/foldingRange - (6)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:03:32.973 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:32 go/packages.Load\n\tsnapshot=1\n\tdirectory=/Users/hakim/ww/wasmvetissue\n\tquery=[file=/Users/hakim/ww/wasmvetissue/wasm/main.go]\n\tpackages=1\n"}

[Trace - 11:03:32.974 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:32 go/packages.Load\n\tsnapshot=1\n\tpackage="command-line-arguments"\n\tfiles=[/Users/hakim/ww/wasmvetissue/wasm/main.go]\n"}

[Trace - 11:03:32.974 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2021/10/29 11:03:32 command-line-arguments:file=/Users/hakim/ww/wasmvetissue/wasm/main.go: no dep handle for syscall/js: no metadata for syscall/js\n\tsnapshot=1\n"}

[Trace - 11:03:32.975 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go","version":1,"diagnostics":[{"range":{"start":{"line":4,"character":7},"end":{"line":4,"character":19}},"severity":1,"code":"BrokenImport","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal?utm_source=gopls#BrokenImport"},"source":"compiler","message":"could not import syscall/js (no required module provides package "syscall/js")"},{"range":{"start":{"line":4,"character":7},"end":{"line":4,"character":19}},"severity":1,"source":"compiler","message":"error while importing syscall/js: build constraints exclude all Go files in /usr/local/Cellar/go/1.17.2/libexec/src/syscall/js"},{"range":{"start":{"line":6,"character":10},"end":{"line":6,"character":15}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal?utm_source=gopls#UndeclaredName"},"source":"compiler","message":"undeclared name: State","tags":[1]},{"range":{"start":{"line":10,"character":1},"end":{"line":10,"character":7}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal?utm_source=gopls#UndeclaredName"},"source":"compiler","message":"undeclared name: Update","tags":[1]}]}

[Info - 11:03:32 AM] 2021/10/29 11:03:32 go/packages.Load
snapshot=1
directory=/Users/hakim/ww/wasmvetissue
query=[file=/Users/hakim/ww/wasmvetissue/wasm/main.go]
packages=1

[Info - 11:03:32 AM] 2021/10/29 11:03:32 go/packages.Load
snapshot=1
package="command-line-arguments"
files=[/Users/hakim/ww/wasmvetissue/wasm/main.go]

[Error - 11:03:32 AM] 2021/10/29 11:03:32 command-line-arguments:file=/Users/hakim/ww/wasmvetissue/wasm/main.go: no dep handle for syscall/js: no metadata for syscall/js
snapshot=1

[Trace - 11:03:33.083 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:33 go/packages.Load\n\tsnapshot=1\n\tpackage="command-line-arguments"\n\tfiles=[/Users/hakim/ww/wasmvetissue/wasm/main.go]\n"}

[Trace - 11:03:33.083 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:03:33 go/packages.Load\n\tsnapshot=1\n\tdirectory=/Users/hakim/ww/wasmvetissue\n\tquery=[file=/Users/hakim/ww/wasmvetissue/wasm/main.go]\n\tpackages=1\n"}

[Trace - 11:03:33.083 AM] Received response 'textDocument/documentLink - (1)' in 533ms.
Result: [{"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":18}},"target":"https://pkg.go.dev/syscall/js?utm_source=gopls"}]

[Error - Received] 11:03:33.083 AM #2 JSON RPC cancelled

[Info - 11:03:33 AM] 2021/10/29 11:03:33 go/packages.Load
snapshot=1
package="command-line-arguments"
files=[/Users/hakim/ww/wasmvetissue/wasm/main.go]

[Trace - 11:03:33.084 AM] Received response 'textDocument/documentSymbol - (3)' in 533ms.
Result: [{"name":"SP","detail":"*invalid type","kind":13,"range":{"start":{"line":6,"character":0},"end":{"line":6,"character":17}},"selectionRange":{"start":{"line":6,"character":4},"end":{"line":6,"character":6}}},{"name":"main","detail":"()","kind":12,"range":{"start":{"line":8,"character":0},"end":{"line":11,"character":1}},"selectionRange":{"start":{"line":8,"character":5},"end":{"line":8,"character":9}}},{"name":"SetA","detail":"(n int)","kind":12,"range":{"start":{"line":13,"character":0},"end":{"line":15,"character":1}},"selectionRange":{"start":{"line":13,"character":5},"end":{"line":13,"character":9}}}]

[Trace - 11:03:33.084 AM] Received response 'textDocument/codeLens - (4)' in 313ms.
Result: null

[Info - 11:03:33 AM] 2021/10/29 11:03:33 go/packages.Load
snapshot=1
directory=/Users/hakim/ww/wasmvetissue
query=[file=/Users/hakim/ww/wasmvetissue/wasm/main.go]
packages=1

[Trace - 11:03:33.085 AM] Received response 'textDocument/codeAction - (5)' in 300ms.
Result: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"documentChanges":[{"textDocument":{"version":1,"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"},"edits":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"newText":"//go:build js \u0026\u0026 wasm\n"}]}]}}]

  • Why didn't gopls report the same errors if reload the window after opening the wasm/main.go file (or, open the workspace which already has wasm/main.go open)?

Is it possible this is related to the fact that textDocument/didOpen message arriving very early. Since this file requires build tags (// +build js,wasm), can this early document processing put gopls in an strange state where complete diagnostics is skipped? (For example, PWD=/Users/hakim/ww/wasmvetissue go list -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin github.com/Michael-F-Ellis/wasmvetissue/... will completely skip this wasm package because there is no build tag matching .go files.

  • Another interesting observation is that the workspace folders are subfolders inside one Go module. So, gopls tries to analyze both folders from the module root directory (not from the folders) so I see a lot of go list wasmvetissue/... calls. I think this logic needs rethought if we want to support multiple workspace root folders within a Go module.
Open workspace while `wasm/main.go` is open, without `"gopls": {"build.env": ...}` setting
[Trace - 11:40:39.752 AM] Sending request 'initialize - (0)'.
Params: {"processId":19745,"clientInfo":{"name":"Visual Studio Code","version":"1.61.2"},"locale":"en-us","rootPath":"/Users/hakim/ww/wasmvetissue/notwasm","rootUri":"file:///Users/hakim/ww/wasmvetissue/notwasm","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false},"linkedEditingRange":{"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"}}},"initializationOptions":{"verboseOutput":true},"trace":"off","workspaceFolders":[{"uri":"file:///Users/hakim/ww/wasmvetissue/notwasm","name":"notwasm"},{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm","name":"wasm"}]}

[Trace - 11:40:39.754 AM] Received response 'initialize - (0)' in 2ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."],"completionItem":{}},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.apply_fix","gopls.check_upgrades","gopls.gc_details","gopls.generate","gopls.generate_gopls_mod","gopls.go_get_package","gopls.list_known_packages","gopls.regenerate_cgo","gopls.remove_dependency","gopls.run_tests","gopls.start_debugging","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor","gopls.workspace_metadata"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"{"path":"golang.org/x/tools/gopls","version":"v0.7.3","sum":"h1:Lru57ht8vtDMouRskFC085VAjBAZRAISd/lwvwOOV0Q=","deps":[{"path":"github.com/BurntSushi/toml","version":"v0.3.1","sum":"h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ="},{"path":"github.com/google/go-cmp","version":"v0.5.6","sum":"h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ="},{"path":"github.com/sergi/go-diff","version":"v1.1.0","sum":"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0="},{"path":"golang.org/x/mod","version":"v0.4.2","sum":"h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo="},{"path":"golang.org/x/sync","version":"v0.0.0-20210220032951-036812b2e83c","sum":"h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ="},{"path":"golang.org/x/sys","version":"v0.0.0-20210809222454-d867a43fc93e","sum":"h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA="},{"path":"golang.org/x/text","version":"v0.3.6","sum":"h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M="},{"path":"golang.org/x/tools","version":"v0.1.8-0.20211014194737-fc98fb2abd48","sum":"h1:hk7xRoeg0CG1nRLsd5BZLDUgVpA9bnKylGk1p2/BPH0="},{"path":"golang.org/x/xerrors","version":"v0.0.0-20200804184101-5ec99f83aff1","sum":"h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE="},{"path":"honnef.co/go/tools","version":"v0.2.0","sum":"h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE="},{"path":"mvdan.cc/gofumpt","version":"v0.1.1","sum":"h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA="},{"path":"mvdan.cc/xurls/v2","version":"v2.3.0","sum":"h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I="}]}"}}

[Trace - 11:40:40.000 AM] Sending notification 'initialized'.
Params: {}

[Trace - 11:40:40.001 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go","languageId":"go","version":1,"text":"// +build js,wasm\n\npackage main\n\nimport "syscall/js"\n\nvar SP = &State{}\n\nfunc main() {\n\tjs.Global().Set("Foo", 1)\n\tUpdate()\n}\n\nfunc SetA(n int) {\n\tSP.A = n\n}\n"}}

[Trace - 11:40:40.001 AM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"5577006791947779410"}

[Trace - 11:40:40.011 AM] Sending response 'window/workDoneProgress/create - (1)' in 10ms.
Result:

[Trace - 11:40:40.011 AM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}

[Trace - 11:40:40.012 AM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/ww/wasmvetissue/notwasm","section":"gopls"}]}

[Trace - 11:40:40.023 AM] Sending response 'workspace/configuration - (2)' in 11ms.
Result: [{"verboseOutput":true}]

[Trace - 11:40:40.033 AM] Sending request 'textDocument/codeAction - (1)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"},"range":{"start":{"line":4,"character":19},"end":{"line":4,"character":19}},"context":{"diagnostics":[]}}

[Trace - 11:40:40.033 AM] Sending request 'textDocument/documentLink - (2)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:40:40.125 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go env for /Users/hakim/ww/wasmvetissue/notwasm\n(root /Users/hakim/ww/wasmvetissue)\n(go version go version go1.17.2 darwin/amd64)\n(valid build configuration = true)\n(build flags: [])\nGOROOT=/usr/local/Cellar/go/1.17.2/libexec\nGOCACHE=/Users/hakim/Library/Caches/go-build\nGOFLAGS=\nGOMODCACHE=/Users/hakim/go/pkg/mod\nGOSUMDB=sum.golang.org\nGONOSUMDB=\nGOPROXY=https://proxy.golang.org,direct\nGONOPROXY=\nGOPATH=/Users/hakim/go\nGO111MODULE=\nGOINSECURE=\nGOMOD=/Users/hakim/ww/wasmvetissue/go.mod\nGOPRIVATE=\n\n"}

[Trace - 11:40:40.128 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 17.604671ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.1339258413.mod -mod=readonly -f "{{context.GOARCH}} {{context.Compiler}}" -- unsafe\n"}

[Trace - 11:40:40.128 AM] Received request 'window/workDoneProgress/create - (3)'.
Params: {"token":"8674665223082153551"}

[Trace - 11:40:40.140 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 29.915236ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=off GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -e -f {{context.ReleaseTags}} -- unsafe\n"}

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go env for /Users/hakim/ww/wasmvetissue/notwasm
(root /Users/hakim/ww/wasmvetissue)
(go version go version go1.17.2 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GOROOT=/usr/local/Cellar/go/1.17.2/libexec
GOCACHE=/Users/hakim/Library/Caches/go-build
GOFLAGS=
GOMODCACHE=/Users/hakim/go/pkg/mod
GOSUMDB=sum.golang.org
GONOSUMDB=
GOPROXY=https://proxy.golang.org,direct
GONOPROXY=
GOPATH=/Users/hakim/go
GO111MODULE=
GOINSECURE=
GOMOD=/Users/hakim/ww/wasmvetissue/go.mod
GOPRIVATE=

[Info - 11:40:40 AM] 2021/10/29 11:40:40 17.604671ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.1339258413.mod -mod=readonly -f "{{context.GOARCH}} {{context.Compiler}}" -- unsafe

[Trace - 11:40:40.220 AM] Sending notification '$/cancelRequest'.
Params: {"id":1}

[Trace - 11:40:40.220 AM] Sending request 'textDocument/codeAction - (3)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"},"range":{"start":{"line":4,"character":19},"end":{"line":4,"character":19}},"context":{"diagnostics":[]}}

[Trace - 11:40:40.220 AM] Sending request 'textDocument/documentSymbol - (4)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:40:40.221 AM] Sending response 'window/workDoneProgress/create - (3)' in 93ms.
Result:

[Trace - 11:40:40.221 AM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}

[Trace - 11:40:40.222 AM] Received request 'workspace/configuration - (4)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/ww/wasmvetissue/wasm","section":"gopls"}]}

[Info - 11:40:40 AM] 2021/10/29 11:40:40 29.915236ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=off GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -e -f {{context.ReleaseTags}} -- unsafe

[Trace - 11:40:40.226 AM] Sending response 'workspace/configuration - (4)' in 3ms.
Result: [{"verboseOutput":true}]

[Trace - 11:40:40.257 AM] Sending request 'textDocument/foldingRange - (5)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:40:40.273 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go env for /Users/hakim/ww/wasmvetissue/wasm\n(root /Users/hakim/ww/wasmvetissue)\n(go version go version go1.17.2 darwin/amd64)\n(valid build configuration = true)\n(build flags: [])\nGOFLAGS=\nGOMOD=/Users/hakim/ww/wasmvetissue/go.mod\nGOPRIVATE=\nGOCACHE=/Users/hakim/Library/Caches/go-build\nGOPROXY=https://proxy.golang.org,direct\nGOSUMDB=sum.golang.org\nGO111MODULE=\nGOINSECURE=\nGOMODCACHE=/Users/hakim/go/pkg/mod\nGONOSUMDB=\nGONOPROXY=\nGOPATH=/Users/hakim/go\nGOROOT=/usr/local/Cellar/go/1.17.2/libexec\n\n"}

[Trace - 11:40:40.278 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 17.216177ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=off GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -e -f {{context.ReleaseTags}} -- unsafe\n"}

[Trace - 11:40:40.280 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 18.277753ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.778982676.mod -mod=readonly -f "{{context.GOARCH}} {{context.Compiler}}" -- unsafe\n"}

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go env for /Users/hakim/ww/wasmvetissue/wasm
(root /Users/hakim/ww/wasmvetissue)
(go version go version go1.17.2 darwin/amd64)
(valid build configuration = true)
(build flags: [])
GOFLAGS=
GOMOD=/Users/hakim/ww/wasmvetissue/go.mod
GOPRIVATE=
GOCACHE=/Users/hakim/Library/Caches/go-build
GOPROXY=https://proxy.golang.org,direct
GOSUMDB=sum.golang.org
GO111MODULE=
GOINSECURE=
GOMODCACHE=/Users/hakim/go/pkg/mod
GONOSUMDB=
GONOPROXY=
GOPATH=/Users/hakim/go
GOROOT=/usr/local/Cellar/go/1.17.2/libexec

[Info - 11:40:40 AM] 2021/10/29 11:40:40 17.216177ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=off GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -e -f {{context.ReleaseTags}} -- unsafe

[Info - 11:40:40 AM] 2021/10/29 11:40:40 18.277753ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.778982676.mod -mod=readonly -f "{{context.GOARCH}} {{context.Compiler}}" -- unsafe

[Trace - 11:40:40.491 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 351.288398ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.1339258413.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin github.com/Michael-F-Ellis/wasmvetissue/...\n"}

[Trace - 11:40:40.495 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tdirectory=/Users/hakim/ww/wasmvetissue\n\tquery=[builtin github.com/Michael-F-Ellis/wasmvetissue/...]\n\tpackages=4\n"}

[Trace - 11:40:40.495 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tpackage="builtin"\n\tfiles=[/usr/local/Cellar/go/1.17.2/libexec/src/builtin/builtin.go]\n"}

[Trace - 11:40:40.495 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tpackage="github.com/Michael-F-Ellis/wasmvetissue"\n\tfiles=[/Users/hakim/ww/wasmvetissue/empty.go]\n"}

[Trace - 11:40:40.496 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tpackage="github.com/Michael-F-Ellis/wasmvetissue/notwasm"\n\tfiles=[/Users/hakim/ww/wasmvetissue/notwasm/main.go]\n"}

[Trace - 11:40:40.506 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 227.897428ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.778982676.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin github.com/Michael-F-Ellis/wasmvetissue/...\n"}

[Trace - 11:40:40.519 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tpackage="builtin"\n\tfiles=[/usr/local/Cellar/go/1.17.2/libexec/src/builtin/builtin.go]\n"}

[Trace - 11:40:40.519 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tpackage="github.com/Michael-F-Ellis/wasmvetissue"\n\tfiles=[/Users/hakim/ww/wasmvetissue/empty.go]\n"}

[Trace - 11:40:40.519 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tdirectory=/Users/hakim/ww/wasmvetissue\n\tquery=[builtin github.com/Michael-F-Ellis/wasmvetissue/...]\n\tpackages=4\n"}

[Trace - 11:40:40.519 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tpackage="github.com/Michael-F-Ellis/wasmvetissue/notwasm"\n\tfiles=[/Users/hakim/ww/wasmvetissue/notwasm/main.go]\n"}

[Trace - 11:40:40.550 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tpackage="github.com/Michael-F-Ellis/wasmvetissue/wasm"\n\tfiles=[/Users/hakim/ww/wasmvetissue/wasm/main.go /Users/hakim/ww/wasmvetissue/wasm/state.go]\n"}

[Trace - 11:40:40.552 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 go/packages.Load\n\tsnapshot=0\n\tpackage="github.com/Michael-F-Ellis/wasmvetissue/wasm"\n\tfiles=[/Users/hakim/ww/wasmvetissue/wasm/main.go /Users/hakim/ww/wasmvetissue/wasm/state.go]\n"}

[Trace - 11:40:40.552 AM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"end","message":"Finished loading packages."}}

[Trace - 11:40:40.554 AM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"end","message":"Finished loading packages."}}

[Trace - 11:40:40.555 AM] Received request 'client/registerCapability - (5)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/*.*tmpl","kind":7},{"globPattern":"/.{go,mod,sum,work,tmpl}","kind":7},{"globPattern":"/Users/hakim/ww/wasmvetissue/**/.{go,mod,sum,work,tmpl}","kind":7},{"globPattern":"{/Users/hakim/ww/wasmvetissue/notwasm,/Users/hakim/ww/wasmvetissue/wasm}","kind":7}]}}]}

[Info - 11:40:40 AM] 2021/10/29 11:40:40 351.288398ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.1339258413.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin github.com/Michael-F-Ellis/wasmvetissue/...

[Trace - 11:40:40.681 AM] Sending request 'textDocument/codeLens - (6)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
directory=/Users/hakim/ww/wasmvetissue
query=[builtin github.com/Michael-F-Ellis/wasmvetissue/...]
packages=4

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
package="builtin"
files=[/usr/local/Cellar/go/1.17.2/libexec/src/builtin/builtin.go]

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
package="github.com/Michael-F-Ellis/wasmvetissue"
files=[/Users/hakim/ww/wasmvetissue/empty.go]

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
package="github.com/Michael-F-Ellis/wasmvetissue/notwasm"
files=[/Users/hakim/ww/wasmvetissue/notwasm/main.go]

[Info - 11:40:40 AM] 2021/10/29 11:40:40 227.897428ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=https://proxy.golang.org,direct PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.778982676.mod -mod=readonly -e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin github.com/Michael-F-Ellis/wasmvetissue/...

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
package="builtin"
files=[/usr/local/Cellar/go/1.17.2/libexec/src/builtin/builtin.go]

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
package="github.com/Michael-F-Ellis/wasmvetissue"
files=[/Users/hakim/ww/wasmvetissue/empty.go]

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
directory=/Users/hakim/ww/wasmvetissue
query=[builtin github.com/Michael-F-Ellis/wasmvetissue/...]
packages=4

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
package="github.com/Michael-F-Ellis/wasmvetissue/notwasm"
files=[/Users/hakim/ww/wasmvetissue/notwasm/main.go]

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
package="github.com/Michael-F-Ellis/wasmvetissue/wasm"
files=[/Users/hakim/ww/wasmvetissue/wasm/main.go /Users/hakim/ww/wasmvetissue/wasm/state.go]

[Info - 11:40:40 AM] 2021/10/29 11:40:40 go/packages.Load
snapshot=0
package="github.com/Michael-F-Ellis/wasmvetissue/wasm"
files=[/Users/hakim/ww/wasmvetissue/wasm/main.go /Users/hakim/ww/wasmvetissue/wasm/state.go]

[Trace - 11:40:40.702 AM] Sending response 'client/registerCapability - (5)' in 147ms.
Result:

[Trace - 11:40:40.702 AM] Received request 'client/registerCapability - (6)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"}]}

[Trace - 11:40:40.703 AM] Sending response 'client/registerCapability - (6)' in 0ms.
Result:

[Error - Received] 11:40:40.705 AM #1 JSON RPC cancelled

[Trace - 11:40:40.714 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 discovered missing identifiers: map[memRecordCycle:true pageBits:true]\n\tpackage="runtime"\n"}

[Info - 11:40:40 AM] 2021/10/29 11:40:40 discovered missing identifiers: map[memRecordCycle:true pageBits:true]
package="runtime"

[Trace - 11:40:40.810 AM] Received response 'textDocument/documentLink - (2)' in 776ms.
Result: [{"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":18}},"target":"https://pkg.go.dev/syscall/js?utm_source=gopls"}]

[Trace - 11:40:40.811 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:40:40 fixImports(filename="/Users/hakim/ww/wasmvetissue/wasm/main.go"), abs="/Users/hakim/ww/wasmvetissue/wasm/main.go", srcDir="/Users/hakim/ww/wasmvetissue/wasm" ...\n"}

[Trace - 11:40:40.811 AM] Received response 'textDocument/codeAction - (3)' in 591ms.
Result: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"documentChanges":[{"textDocument":{"version":1,"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"},"edits":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"newText":"//go:build js \u0026\u0026 wasm\n"}]}]}}]

[Trace - 11:40:40.812 AM] Received response 'textDocument/documentSymbol - (4)' in 591ms.
Result: [{"name":"SP","detail":"*State","kind":13,"range":{"start":{"line":6,"character":0},"end":{"line":6,"character":17}},"selectionRange":{"start":{"line":6,"character":4},"end":{"line":6,"character":6}}},{"name":"main","detail":"()","kind":12,"range":{"start":{"line":8,"character":0},"end":{"line":11,"character":1}},"selectionRange":{"start":{"line":8,"character":5},"end":{"line":8,"character":9}}},{"name":"SetA","detail":"(n int)","kind":12,"range":{"start":{"line":13,"character":0},"end":{"line":15,"character":1}},"selectionRange":{"start":{"line":13,"character":5},"end":{"line":13,"character":9}}}]

[Trace - 11:40:40.812 AM] Received response 'textDocument/foldingRange - (5)' in 554ms.
Result: [{"startLine":8,"startCharacter":13,"endLine":10,"endCharacter":9},{"startLine":13,"startCharacter":18,"endLine":14,"endCharacter":9}]

[Trace - 11:40:40.812 AM] Received response 'textDocument/codeLens - (6)' in 130ms.
Result: null

[Info - 11:40:40 AM] 2021/10/29 11:40:40 fixImports(filename="/Users/hakim/ww/wasmvetissue/wasm/main.go"), abs="/Users/hakim/ww/wasmvetissue/wasm/main.go", srcDir="/Users/hakim/ww/wasmvetissue/wasm" ...

[Trace - 11:40:41.233 AM] Sending request 'textDocument/documentSymbol - (7)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:40:41.234 AM] Received response 'textDocument/documentSymbol - (7)' in 0ms.
Result: [{"name":"SP","detail":"*State","kind":13,"range":{"start":{"line":6,"character":0},"end":{"line":6,"character":17}},"selectionRange":{"start":{"line":6,"character":4},"end":{"line":6,"character":6}}},{"name":"main","detail":"()","kind":12,"range":{"start":{"line":8,"character":0},"end":{"line":11,"character":1}},"selectionRange":{"start":{"line":8,"character":5},"end":{"line":8,"character":9}}},{"name":"SetA","detail":"(n int)","kind":12,"range":{"start":{"line":13,"character":0},"end":{"line":15,"character":1}},"selectionRange":{"start":{"line":13,"character":5},"end":{"line":13,"character":9}}}]

[Trace - 11:40:41.329 AM] Sending request 'textDocument/documentLink - (8)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:40:41.333 AM] Received response 'textDocument/documentLink - (8)' in 3ms.
Result: [{"range":{"start":{"line":4,"character":8},"end":{"line":4,"character":18}},"target":"https://pkg.go.dev/syscall/js?utm_source=gopls"}]

[Trace - 11:40:41.431 AM] Sending request 'textDocument/codeLens - (9)'.
Params: {"textDocument":{"uri":"file:///Users/hakim/ww/wasmvetissue/wasm/main.go"}}

[Trace - 11:40:41.432 AM] Received response 'textDocument/codeLens - (9)' in 0ms.
Result: null

[Trace - 11:41:10.827 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 13.187093ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=off PWD=/Users/hakim/ww/wasmvetissue go env -json GO111MODULE GOFLAGS GOINSECURE GOMOD GOMODCACHE GONOPROXY GONOSUMDB GOPATH GOPROXY GOROOT GOSUMDB\n"}

[Info - 11:41:10 AM] 2021/10/29 11:41:10 13.187093ms for GOROOT= GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=off PWD=/Users/hakim/ww/wasmvetissue go env -json GO111MODULE GOFLAGS GOINSECURE GOMOD GOMODCACHE GONOPROXY GONOSUMDB GOPATH GOPROXY GOROOT GOSUMDB

[Trace - 11:41:10.827 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 background imports cache refresh starting\n"}

[Info - 11:41:10 AM] 2021/10/29 11:41:10 background imports cache refresh starting

[Trace - 11:41:10.839 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 10.447682ms for GOROOT=/usr/local/Cellar/go/1.17.2/libexec GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=off PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.1652606679.mod -mod=readonly -m -f "{{.Path}}\n{{.Dir}}\n{{.GoMod}}\n{{.GoVersion}}\n{{range context.ReleaseTags}}{{if eq . \"go1.14\"}}{{.}}{{end}}{{end}}\n"\n"}

[Info - 11:41:10 AM] 2021/10/29 11:41:10 10.447682ms for GOROOT=/usr/local/Cellar/go/1.17.2/libexec GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=off PWD=/Users/hakim/ww/wasmvetissue go list -modfile=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go.a694fce73234f547817e13f3be1ff114937c0eb25c949659e9c9c806b3cb0f6c.1652606679.mod -mod=readonly -m -f "{{.Path}}\n{{.Dir}}\n{{.GoMod}}\n{{.GoVersion}}\n{{range context.ReleaseTags}}{{if eq . "go1.14"}}{{.}}{{end}}{{end}}\n"

[Trace - 11:41:10.850 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 10.021493ms for GOROOT=/usr/local/Cellar/go/1.17.2/libexec GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=off PWD=/Users/hakim/ww/wasmvetissue go env GOFLAGS\n"}

[Info - 11:41:10 AM] 2021/10/29 11:41:10 10.021493ms for GOROOT=/usr/local/Cellar/go/1.17.2/libexec GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=off PWD=/Users/hakim/ww/wasmvetissue go env GOFLAGS

[Trace - 11:41:10.860 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 9.798091ms for GOROOT=/usr/local/Cellar/go/1.17.2/libexec GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=off PWD=/Users/hakim/ww/wasmvetissue go list -m -e -json ...\n"}

[Info - 11:41:10 AM] 2021/10/29 11:41:10 9.798091ms for GOROOT=/usr/local/Cellar/go/1.17.2/libexec GOPATH=/Users/hakim/go GO111MODULE=auto GOPROXY=off PWD=/Users/hakim/ww/wasmvetissue go list -m -e -json ...

[Trace - 11:41:10.861 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 gopathwalk: scanning /Users/hakim/ww/wasmvetissue\n"}

[Info - 11:41:10 AM] 2021/10/29 11:41:10 gopathwalk: scanning /Users/hakim/ww/wasmvetissue

[Trace - 11:41:10.862 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 gopathwalk: scanning /Users/hakim/go/pkg/mod\n"}

[Trace - 11:41:10.862 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 gopathwalk: scanned /Users/hakim/ww/wasmvetissue in 875.27µs\n"}

[Trace - 11:41:10.862 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:10 Directory added to ignore list: /Users/hakim/go/pkg/mod/cache\n"}

[Info - 11:41:10 AM] 2021/10/29 11:41:10 gopathwalk: scanning /Users/hakim/go/pkg/mod

[Info - 11:41:10 AM] 2021/10/29 11:41:10 gopathwalk: scanned /Users/hakim/ww/wasmvetissue in 875.27µs

[Info - 11:41:10 AM] 2021/10/29 11:41:10 Directory added to ignore list: /Users/hakim/go/pkg/mod/cache

[Trace - 11:41:11.254 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:11 gopathwalk: scanned /Users/hakim/go/pkg/mod in 391.814254ms\n"}

[Trace - 11:41:11.254 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2021/10/29 11:41:11 background refresh finished after 441.258317ms\n"}

[Info - 11:41:11 AM] 2021/10/29 11:41:11 gopathwalk: scanned /Users/hakim/go/pkg/mod in 391.814254ms

[Info - 11:41:11 AM] 2021/10/29 11:41:11 background refresh finished after 441.258317ms

@findleyr findleyr removed this from the Unplanned milestone Oct 29, 2021
@findleyr findleyr added this to the Untriaged milestone Oct 29, 2021
@findleyr findleyr self-assigned this Oct 29, 2021
@findleyr
Copy link
Contributor

@findleyr findleyr commented Oct 29, 2021

Assigning to myself to investigate the gopls side of this.

@hyangah hyangah removed the WaitingForInfo label Oct 29, 2021
@suzmue suzmue removed this from the Untriaged milestone Nov 1, 2021
@suzmue suzmue added this to the Unplanned milestone Nov 1, 2021
@mokiat
Copy link

@mokiat mokiat commented Mar 16, 2022

I was having issues trying to get a multi-root workspace environment working. One of the projects needed GOOS=js, whereas the other needed cgo. I could not get both to work correctly in vscode.

Using the proposed setting above helped and now I can work with both projects:

{
	"go.toolsEnvVars": {
		"GOOS": "js",
		"GOARCH": "wasm",
	},
	"gopls": {
		"build.env": {
			"GOOS": "js",
			"GOARCH": "wasm",
		}
	}
}

(I was lacking the gopls section in my case and relied only on the go.toolsEnvVars)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants