-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: panic in hover on v0.7.2-pre.1 #48249
Comments
Note, I do not use CRLF line-endings. |
Aha, thanks for pointing that out. Updated the issue accordingly. |
Change https://golang.org/cl/348429 mentions this issue: |
@egonelbre: Are you able to reproduce this panic, and if so, do you mind sharing the code and user actions that trigger it? I'm not able to reproduce it. |
@stamblerre not reliably, but it does happen fairly frequently. I'll see whether I can figure out some pattern to the problem. |
This shows up every now and then--maybe we need a wrapper function around token.Offset to check the range. Updates golang/go#48249 Change-Id: I9c60bc7cc61fcfb2f4e8c6963586d8b8fbb21835 Reviewed-on: https://go-review.googlesource.com/c/tools/+/348429 Trust: Rebecca Stambler <[email protected]> Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]>
Change https://golang.org/cl/348530 mentions this issue: |
This shows up every now and then--maybe we need a wrapper function around token.Offset to check the range. Updates golang/go#48249 Change-Id: I9c60bc7cc61fcfb2f4e8c6963586d8b8fbb21835 Reviewed-on: https://go-review.googlesource.com/c/tools/+/348429 Trust: Rebecca Stambler <[email protected]> Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> (cherry picked from commit 0a6f080) Reviewed-on: https://go-review.googlesource.com/c/tools/+/348530
I can reliably reproduce the issue with a single file:
In Sublime Text add a space after |
And here's a trace:
|
Thanks for the repro case! I was able to reproduce and add a test for this. |
Change https://golang.org/cl/348930 mentions this issue: |
Filed #48300 for the idiosyncracy in go/ast and go/parser that contributed to this panic, though the gopls code should have been more robust. I think we can close this with CL 348930. Thanks again @egonelbre for reporting. |
Change https://golang.org/cl/348969 mentions this issue: |
The panic below was reported by @egonelbre in slack:
The bug appears to be here, where s.End() is out of bounds of the file:
https://cs.opensource.google/go/x/tools/+/master:internal/lsp/source/hover.go;l=344;drc=f09387104b6e0982cb7ded78fee831c96ca49429
The text was updated successfully, but these errors were encountered: