x/tools/gopls: call to IsGenerated ocassionally has nil Snapshot causing panic #41778
Milestone
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What did you do?
This is sporadic, and I'm not entirely sure how to reliably repoduce it; my current approach to reproduction is to to open new files and make modifications. About 1/20 times, this will cause this crash.
I am using gopls with sublimelsp/LSP as recommended. ST3.
What did you expect to see?
No crash.
What did you see instead?
A crash.
This is a consequence of filling
snapshotByURI
withnil
Snaphot
s here and then if asnapshot
value isnil
here leaving it there. Finally, the check for valid snaphots here uses map presence rather thanSnapshot
nil
-ness as the check for validity.Either the validity check in the generated code check loop should be for non-
nil
Snapshot
sor probably better, remove the
snapshotByURI
elements that are nil in the check above.Maybe both.
Build info
golang/tools@9647ced
The text was updated successfully, but these errors were encountered: