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() { |