-
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.
gopls/internal/cache/parsego: support lazy object resolution for Files
For the purposes of go/analysis, gopls could not skip syntactic object resolution, as it is part of the go/analysis contract. This prevents analysis from reusing existing type-checked packages, leading to increased CPU and memory during diagnostics. Fix this by making object resolution lazy, and ensuring that all analysed files are resolved prior to analysis. This could introduce a race if gopls were to read the fields set by object resolution, for example if it was printing the tree using ast.Fprint, so we include a test that these fields are only accessed from packages or declarations that are verified to be safe. Since the resolver is not separate from the parser, we fork the code and use go generate to keep it in sync. For golang/go#53275 Change-Id: I24ce94b5d8532c5e679789d2ec1f75376e9e9208 Reviewed-on: https://go-review.googlesource.com/c/tools/+/619516 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
9 changed files
with
892 additions
and
11 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
Oops, something went wrong.