-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit acaae98
committed
gopls/internal/lsp/cache: stream package results
As we move toward incremental evaluation of the package key and precise
pruning, rewrite the type checking pass to formalize the concept of a
pre- and post- package visitor. Whereas previously we would do an
initial pass outside of type-checking to load data (xrefs, diagnostics,
etc), we now integrate loads checks with the batch operation, calling
a pre- func immediately before type-checking, and a post- func
immediately afterward.
This change was originally intended only to move us toward precise
pruning, but inadvertently simplified and clarified many aspects of
type-checking. Namely, it:
- resulted in eliminating all state from the type check batch;
typeCheckBatch.mu is deleted
- allows avoiding double-encoding of diagnostics and method sets, to fit
the previous APIs. This results in a significant improvement in the
methodsets benchmarks
- significantly simplifies the logic of the type-checking batch
- significantly reduces the high water mark during the IWL, as the GC
can clean up the packages that are no longer pinned to the batch
For golang/go#57987
Change-Id: Iad1073f32cea0a7e26567d94cdd3ed01ff60ad04
Reviewed-on: https://go-review.googlesource.com/c/tools/+/476956
gopls-CI: kokoro <[email protected]>
Run-TryBot: Robert Findley <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>1 parent fa55648 commit acaae98Copy full SHA for acaae98
File tree
Expand file treeCollapse file tree
3 files changed
+199
-273
lines changedFilter options
- gopls
- internal/lsp/cache
Expand file treeCollapse file tree
3 files changed
+199
-273
lines changed
0 commit comments