golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.86k stars 741 forks source link

gopls: crash due to use of workspace folders with non-file uri scheme #3368

Closed gilde1337 closed 4 months ago

gilde1337 commented 5 months ago

gopls version: v0.15.3/go1.22.2 gopls flags: update flags: proxy extension version: 0.41.4 environment: Visual Studio Code win32 initialization error: Error: invalid WorkspaceFolder.URI: DocumentURI scheme is not 'file': decompileFs:/ issue timestamp: Fri, 26 Apr 2024 17:59:38 GMT restart history: Fri, 26 Apr 2024 17:59:35 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

Please attach the stack trace from the crash. A window with the error message should have popped up in the lower half of your screen. Please copy the stack trace and error messages from that window and paste it in this issue. Failed to auto-collect gopls trace: no gopls log.
gopls stats -anon { "DirStats": { "Files": 0, "TestdataFiles": 0, "GoFiles": 0, "ModFiles": 0, "Dirs": 3 }, "GOARCH": "amd64", "GOOS": "windows", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.2", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "413.9466ms", "MemStats": { "HeapAlloc": 2536344, "HeapInUse": 4997120, "TotalAlloc": 10544536 }, "WorkspaceStats": { "Files": { "Total": 0, "Largest": 0, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.2", "AllPackages": { "Packages": 0, "LargestPackage": 0, "CompiledGoFiles": 0, "Modules": 0 }, "WorkspacePackages": { "Packages": 0, "LargestPackage": 0, "CompiledGoFiles": 0, "Modules": 0 }, "Diagnostics": 0 } ] } }
OPTIONAL: If you would like to share more information, you can attach your complete gopls logs. NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE. DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.
hyangah commented 5 months ago

Thanks @gilde1337 Are you using the decompiler extension, while working on Go files in other workspace folders? Or are you trying to open a go file in the archive the decompiler extension decompiles?

Looks like the extension is registering a workspace folder over this virtual file system https://github.com/tintinweb/vscode-decompiler/blob/master/src/features/decompile.js#L88 but gopls cannot handle it.

cc @golang/tools-team

gopherbot commented 4 months ago

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

findleyr commented 4 months ago

I don't think this is still waiting for info: it was actionable.

adonovan commented 4 months ago

@hyangah fixed it in https://github.com/golang/go/issues/67225, I think.