-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/lsp/cache: invalidate analysis results on packages.Load
Most invalidation happens in snapshot.clone, but to be safe we were also invalidating package data when new metadata is set via packages.Load. At the time, I wasn't sure why this was necessary. Now I understand: with experimentalUseInvalidMetadata it is possible that we re-compute invalidated data using stale metadata in between the initial clone and the subsequent reload. I noticed that it was also possible to have stale analysis results after the Load results arrive. Fix this by invalidating analysis results on Load, in addition to packages. Factor out invalidation into a new helper method. Since we believe this may fix analyzer panics, re-enable strict handling of analysis panics during tests. For golang/go#56035 For golang/go#54762 For golang/go#42857 Change-Id: I8c28e0700f8c16c58df4ecf60f6127b1c05d6dc5 Reviewed-on: https://go-review.googlesource.com/c/tools/+/420538 Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Gopher Robot <[email protected]> gopls-CI: kokoro <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
- Loading branch information
Showing
4 changed files
with
48 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters