Index: pkg/analyzer/lib/src/generated/engine.dart |
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart |
index 399959cd4ed2bba0360878d89f0da50d81eb90dc..bf4be15eec24c7dcc028027ba905563ace3900e0 100644 |
--- a/pkg/analyzer/lib/src/generated/engine.dart |
+++ b/pkg/analyzer/lib/src/generated/engine.dart |
@@ -451,6 +451,13 @@ abstract class AnalysisContext { |
void set sourceFactory(SourceFactory factory); |
/** |
+ * Return an array containing all of the sources known to this context. |
+ * |
+ * @return all of the sources known to this context |
+ */ |
+ List<Source> get sources; |
+ |
+ /** |
* Returns a type provider for this context or throws [AnalysisException] if |
* `dart:core` or `dart:async` cannot be resolved. |
*/ |
@@ -1447,6 +1454,16 @@ class AnalysisContextImpl implements InternalAnalysisContext { |
_invalidateAllLocalResolutionInformation(true); |
} |
+ @override |
+ List<Source> get sources { |
+ List<Source> sources = new List<Source>(); |
+ MapIterator<Source, SourceEntry> iterator = _cache.iterator(); |
+ while (iterator.moveNext()) { |
+ sources.add(iterator.key); |
+ } |
+ return sources; |
+ } |
+ |
/** |
* Return a list of the sources that would be processed by [performAnalysisTask]. This |
* method duplicates, and must therefore be kept in sync with, [getNextAnalysisTask]. |