-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: panic after failed PosRange in xrefs.Index #67704
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
Comments
CC @adonovan this is a new one. Transferring to the Go issue tracker. |
This is the offending line, complete with "can't fail" comment. ;-) nodeRange := func(n ast.Node) protocol.Range {
rng, err := pgf.PosRange(n.Pos(), n.End())
if err != nil {
panic(err) // can't fail
}
return rng
} Interpreting the stack, the offending Node is the |
Hi @perrybenyella, do you remember how you triggered this crash while working in test_test.go? If you're able to reproduce it, that would be a great help for us trying to fix it. Thanks! |
Bumping to the next milestone as this code has not changed recently, and this is our first report of this crash. Hopefully we can get a reproducer. |
I am not exactly sure, but I was working on a project on vscode using the live share extension with a couple of other collaborators. Then we made edits to the files (test_test.go was one of these files), and for some reason, we weren't able to save the changes we made to the files while working. Because of that, I had to restart my vs code each tim,\e it happened. This kind of happend a few times. It also seemed to be an issue that only my computer was affected by because the other collaborators did not experience it when they used their own live share links. |
Absent a reproducer, I'm afraid we're unlikely to be able to fix this. Moving to the backlog. |
Change https://go.dev/cl/668238 mentions this issue: |
Change https://go.dev/cl/668677 mentions this issue: |
Change https://go.dev/cl/672055 mentions this issue: |
This CL extracts the good bits out of a large exploratory patch (CL 668677) to update x/tools in anticipation of parser and AST changes that I was hoping to land in go1.25; however that isn't going to happen. Updates golang/go#73438 Updates golang/go#66790 Updates golang/go#66683 Updates golang/go#67704 Change-Id: Iba4a0a7c4a93d04fc6d46466c9fb9980d52067a3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/672055 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]>
gopls version: v0.15.3/go1.22.1
gopls flags:
update flags: proxy
extension version: 0.41.4
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Sun, 26 May 2024 22:40:43 GMT
restart history:
Sun, 26 May 2024 21:36:23 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
gopls stats -anon
{ "DirStats": { "Files": 440, "TestdataFiles": 0, "GoFiles": 44, "ModFiles": 2, "Dirs": 198 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.1", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "88.230458ms", "MemStats": { "HeapAlloc": 2537088, "HeapInUse": 4964352, "TotalAlloc": 11719808 }, "WorkspaceStats": { "Files": { "Total": 0, "Largest": 0, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.1", "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.
<OPTIONAL: ATTACH LOGS HERE>
The text was updated successfully, but these errors were encountered: