-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve support for package-with-macro-application (#3687)
The previous fix is no good; it was concerned with _augmentations_, assuming they cannot be read from disk. This is not the case. Only a macro-generated augmentation cannot be read from disk. Instead we change tactics and say we _can_ include source code from a macro (maybe we shouldn't), and just ask analyzer for all source files, from the AnalysisContext. Other changes to facilitate this: * Do not dispose the AnalysisContextCollection right away; we should wait until all docs are generated. * Pass the AnalysisContext to ModelNode, and no longer pass the ResourceProvider. * Remove the file cache thing in model_utils; instead ModelNode.sourceCode only relies on the AnalysisContext. Theoretically there is already caching over that at analyzer? But I benchmarked with Flutter and saw no time-to-document or max-RSS changes. * Do not ask the AnalysisContextCollection for the AnalysisContext _for every file_! Cache it. To facilitate that, change `PubPackageBuilder()` into a factory. * Sort the fields instantiated by the `PackageGraph.uninitialized` constructor above it. * In `addFilesReferencedBy`, also look at augmentation imports.
- Loading branch information
Showing
8 changed files
with
117 additions
and
108 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
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.