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: crash when go.work file is identified by the client as a go.mod file #53704

Open
csuzhangxc opened this issue Jul 6, 2022 · 3 comments
Labels
gopls/workspace Issues related to support for modules or multi-module workspaces. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@csuzhangxc
Copy link

gopls version: v0.8.4
gopls flags:
update flags: proxy
extension version: 0.29.0
go version: 1.18.1
environment: code-server linux
initialization error: undefined
issue timestamp: Wed, 06 Jul 2022 07:10:29 GMT
restart history:
Wed, 06 Jul 2022 07:09:30 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: interface conversion: interface {} is *cache.parseWorkData, not *cache.parseModData

goroutine 214 [running]:
golang.org/x/tools/internal/lsp/cache.(*parseModHandle).parse(0x842280%3F, {0xbab180%3F, 0x4000492b00%3F}, 0x44%3F)
	  mod.go:42  0x98
golang.org/x/tools/internal/lsp/cache.(*snapshot).ParseMod(0x40002938c0, {0xbab180, 0x4000492b00}, {0xbab4c8, 0x4000209aa0})
	  mod.go:101  0x270
golang.org/x/tools/internal/lsp.modLinks({0xbab180, 0x4000492b00}, {0xbb3868, 0x40002938c0}, {0xbab4c8%3F, 0x4000209aa0%3F})
	  link.go:48  0x60
golang.org/x/tools/internal/lsp.(*Server).documentLink(0x4000740ea0%3F, {0xbab180, 0x4000492b00}, 0x400079a630%3F)
	  link.go:35  0xfc
golang.org/x/tools/internal/lsp.(*Server).DocumentLink(0x400082c300%3F, {0xbab180%3F, 0x4000492b00%3F}, 0x7ea2a0%3F)
	  server_gen.go:120  0x28
golang.org/x/tools/internal/lsp/protocol.serverDispatch({0xbab180, 0x4000492b00}, {0xbb6fe0, 0x40004ce6c0}, 0x4000740e70, {0xbab420, 0x4000492a00})
	  tsserver.go:677  0x2468
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1({0xbab180, 0x4000492b00}, 0x4000740e70, {0xbab420, 0x4000492a00})
	  protocol.go:157  0x70
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1({0xbab180, 0x4000492b00}, 0x4000740e70, {0xbab420%3F, 0x4000492a00%3F})
	  lsprpc.go:511  0x7d4
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1({0xbab180, 0x4000492b00}, 0x4000206a38, {0xbab420%3F, 0x4000492a00%3F})
	  handler.go:35  0xfc
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2()
	  handler.go:103  0x90
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	  handler.go:100  0x1ec
[Error - 7:10:13 AM] 

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.

<OPTIONAL: ATTACH LOGS HERE>

@findleyr
Copy link
Contributor

findleyr commented Jul 6, 2022

I can reproduce this in VS Code by switching the file type of my go.work file to Go Module file.

@findleyr
Copy link
Contributor

findleyr commented Jul 6, 2022

Thank you for reporting this. Transferring to the gopls issue tracker.

@findleyr findleyr changed the title gopls: automated issue report (crash) x/tools/gopls: crash when go.work file is identified by the client as a go.mod file Jul 6, 2022
@findleyr findleyr transferred this issue from golang/vscode-go Jul 6, 2022
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jul 6, 2022
@gopherbot gopherbot added this to the Unreleased milestone Jul 6, 2022
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.9.1 Jul 6, 2022
@findleyr findleyr modified the milestones: gopls/v0.9.1, gopls/v0.9.2 Jul 13, 2022
@findleyr findleyr added the gopls/workspace Issues related to support for modules or multi-module workspaces. label Jul 14, 2022
@findleyr
Copy link
Contributor

findleyr commented Aug 2, 2022

Test setup is a bit tricky here, and this is not urgent, so bumping to v0.10.0 in favor of other priorities.

@findleyr findleyr modified the milestones: gopls/v0.9.2, gopls/v0.10.0 Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls/workspace Issues related to support for modules or multi-module workspaces. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants