diff --git a/lib/src/model/package_builder.dart b/lib/src/model/package_builder.dart index 23921debae..75d34e52f1 100644 --- a/lib/src/model/package_builder.dart +++ b/lib/src/model/package_builder.dart @@ -190,10 +190,9 @@ class PubPackageBuilder implements PackageBuilder { Future _resolveLibrary(String filePath) async { logDebug('Resolving $filePath...'); - var analysisContext = _contextCollection.contextFor(_config.inputDir); // Allow dart source files with inappropriate suffixes (#1897). final library = - await analysisContext.currentSession.getResolvedLibrary(filePath); + await _analysisContext.currentSession.getResolvedLibrary(filePath); if (library is ResolvedLibraryResult) { return DartDocResolvedLibrary(library); } diff --git a/lib/src/model/package_graph.dart b/lib/src/model/package_graph.dart index 0ea5d982bc..2107255d19 100644 --- a/lib/src/model/package_graph.dart +++ b/lib/src/model/package_graph.dart @@ -43,7 +43,7 @@ class PackageGraph with CommentReferable, Nameable { final InheritanceManager3 inheritanceManager = InheritanceManager3(); - final AnalysisContext analysisContext; + final AnalysisContext _analysisContext; /// PackageMeta for the default package. final PackageMeta packageMeta; @@ -55,7 +55,7 @@ class PackageGraph with CommentReferable, Nameable { DartSdk sdk, this.hasEmbedderSdk, this.packageMetaProvider, - this.analysisContext, + this._analysisContext, ) : packageMeta = config.topLevelPackageMeta, sdkLibrarySources = { for (var lib in sdk.sdkLibraries) sdk.mapDartUri(lib.shortName): lib @@ -244,7 +244,7 @@ class PackageGraph with CommentReferable, Nameable { () => ModelNode( directive, resolvedLibrary.element, - analysisContext, + _analysisContext, commentData: commentData, )); } @@ -299,7 +299,7 @@ class PackageGraph with CommentReferable, Nameable { () => ModelNode( declaration, element, - analysisContext, + _analysisContext, commentData: commentData, ), );