Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Unified Diff: pkg/analyzer/lib/src/task/dart_work_manager.dart

Issue 2188523004: DartWorkManager.getLibrariesContainingPart() should ask the ResultProvider for CONTAINING_LIBRARIES. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/task/dart_work_manager.dart
diff --git a/pkg/analyzer/lib/src/task/dart_work_manager.dart b/pkg/analyzer/lib/src/task/dart_work_manager.dart
index 6b2a96ecc7c2a8344667bf150b9b92ab4159e2e2..7de97e493c1fca73e9579a811f0e0288de004b87 100644
--- a/pkg/analyzer/lib/src/task/dart_work_manager.dart
+++ b/pkg/analyzer/lib/src/task/dart_work_manager.dart
@@ -202,6 +202,7 @@ class DartWorkManager implements WorkManager {
}
}
List<Source> libraries = partLibrariesMap[part];
+ libraries ??= _getLibrariesContainingPartFromResultProvider(part);
return libraries?.toList() ?? Source.EMPTY_LIST;
}
@@ -355,6 +356,19 @@ class DartWorkManager implements WorkManager {
}
/**
+ * Ask the [context]'s result provider for [CONTAINING_LIBRARIES].
+ * Return the list of containing libraries, or `null` if unknown.
+ */
+ List<Source> _getLibrariesContainingPartFromResultProvider(Source part) {
+ CacheEntry cacheEntry = context.getCacheEntry(part);
+ bool knows = context.aboutToComputeResult(cacheEntry, CONTAINING_LIBRARIES);
+ if (knows) {
+ return cacheEntry.getValue(CONTAINING_LIBRARIES);
+ }
+ return null;
+ }
+
+ /**
* Return the SDK [DartWorkManager] or this one.
*/
DartWorkManager _getSdkDartWorkManager() {
« no previous file with comments | « pkg/analyzer/lib/src/summary/package_bundle_reader.dart ('k') | pkg/analyzer/test/src/task/dart_work_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698