-
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: share goimports state for GOMODCACHE
When using the gopls daemon, or with the multi-View workspaces that will be increasingly common following golang/go#57979, there is a lot of redundant work performed scanning the module cache. This CL eliminates that redundancy, by moving module cache information into the cache.Cache shared by all Sessions and Views. There should be effectively no change in behavior for gopls resulting from this CL. In ModuleResolver.scan, we still require that module cache roots are scanned. However, we no longer invalidate this scan in ModuleResolver.ClearForNewScan: re-scanning the module cache is the responsibility of a new ScanModuleCache function, which is independently scheduled. To enable this separation of refresh logic, a new refreshTimer type is extracted to encapsulate the refresh logic. For golang/go#44863 Change-Id: I333d55fca009be7984a514ed4abdc9a9fcafc08a Reviewed-on: https://go-review.googlesource.com/c/tools/+/559636 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
7 changed files
with
332 additions
and
75 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.