@@ -36,18 +36,23 @@ import 'package:meta/meta.dart';
3636class PackageGraph with CommentReferable , Nameable , ModelBuilder {
3737 PackageGraph .uninitialized (
3838 this .config,
39- this . sdk,
39+ DartSdk sdk,
4040 this .hasEmbedderSdk,
4141 this .rendererFactory,
4242 this .packageMetaProvider,
43- ) : packageMeta = config.topLevelPackageMeta {
43+ ) : packageMeta = config.topLevelPackageMeta,
44+ sdkLibrarySources = {
45+ for (var lib in sdk.sdkLibraries) sdk.mapDartUri (lib.shortName): lib
46+ } {
4447 // Make sure the default package exists, even if it has no libraries.
4548 // This can happen for packages that only contain embedder SDKs.
4649 Package .fromPackageMeta (packageMeta, this );
4750 }
4851
4952 final InheritanceManager3 inheritanceManager = InheritanceManager3 ();
5053
54+ final Map <Source ?, SdkLibrary > sdkLibrarySources;
55+
5156 void dispose () {
5257 // Clear out any cached tool snapshots and temporary directories.
5358 // TODO(jcollins-g): Consider ownership change for these objects
@@ -132,7 +137,7 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
132137 // Emit warnings for any local package that has no libraries.
133138 // This must be done after the [allModelElements] traversal to be sure that
134139 // all packages are picked up.
135- for (var package in documentedPackages ) {
140+ for (var package in _documentedPackages ) {
136141 for (var library in package.libraries) {
137142 _addToImplementors (library.allClasses);
138143 _addToImplementors (library.mixins);
@@ -356,12 +361,6 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
356361
357362 ResourceProvider get resourceProvider => config.resourceProvider;
358363
359- final DartSdk sdk;
360-
361- late final Map <Source ?, SdkLibrary > sdkLibrarySources = {
362- for (var lib in sdk.sdkLibraries) sdk.mapDartUri (lib.shortName): lib
363- };
364-
365364 final Map <String , String > _macros = {};
366365 final Map <String , String > _htmlFragments = {};
367366 bool allLibrariesAdded = false ;
@@ -491,7 +490,7 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
491490 publicPackages.where ((p) => p.isLocal).toList (growable: false );
492491
493492 /// Documented packages are documented somewhere (local or remote).
494- Iterable <Package > get documentedPackages =>
493+ Iterable <Package > get _documentedPackages =>
495494 packages.where ((p) => p.documentedWhere != DocumentLocation .missing);
496495
497496 /// A mapping of all the [Library] s that export a given [LibraryElement] .
@@ -671,16 +670,16 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
671670
672671 /// The set of [Class] objects that are similar to 'pragma' in that we should
673672 /// never count them as documentable annotations.
674- late final Set <Class > invisibleAnnotations = () {
673+ late final Set <Class > _invisibleAnnotations = () {
675674 var pragmaSpecialClass = specialClasses[SpecialClass .pragma];
676675 if (pragmaSpecialClass == null ) {
677676 return const < Class > {};
678677 }
679678 return {pragmaSpecialClass};
680679 }();
681680
682- bool isAnnotationVisible (Class clazz ) =>
683- ! invisibleAnnotations .contains (clazz );
681+ bool isAnnotationVisible (Class class_ ) =>
682+ ! _invisibleAnnotations .contains (class_ );
684683
685684 @override
686685 String toString () {
@@ -897,9 +896,6 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
897896 for (var library in _localLibraries) ...library.allModelElements
898897 ];
899898
900- Iterable <ModelElement > get allCanonicalModelElements =>
901- allLocalModelElements.where ((e) => e.isCanonical);
902-
903899 /// Glob lookups can be expensive. Cache per filename.
904900 final _configSetsNodocFor = HashMap <String , bool >();
905901
@@ -958,7 +954,7 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
958954 // on ambiguous resolution (see below) will change where they
959955 // resolve based on internal implementation details.
960956 var sortedPackages = packages.toList (growable: false )..sort (byName);
961- var sortedDocumentedPackages = documentedPackages .toList (growable: false )
957+ var sortedDocumentedPackages = _documentedPackages .toList (growable: false )
962958 ..sort (byName);
963959 // Packages are the top priority.
964960 children.addEntries (sortedPackages.generateEntries ());
0 commit comments