Index: pkg/analysis_server/lib/src/context_manager.dart |
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart |
index 0226b7c561a0676dadc9e034f8901ee0318299c7..c8ad45e5d4486c82f3a6ae7cbfcd88a6cb229ee5 100644 |
--- a/pkg/analysis_server/lib/src/context_manager.dart |
+++ b/pkg/analysis_server/lib/src/context_manager.dart |
@@ -228,6 +228,12 @@ abstract class ContextManager { |
// TODO(brianwilkerson) Move this class to a public library. |
/** |
+ * Return the [AnalysisContext]s that are being used to analyze the analysis |
+ * roots. |
+ */ |
+ Iterable<AnalysisContext> get analysisContexts; |
+ |
+ /** |
* Get the callback interface used to create, destroy, and update contexts. |
*/ |
ContextManagerCallbacks get callbacks; |
@@ -244,6 +250,12 @@ abstract class ContextManager { |
List<String> get excludedPaths; |
/** |
+ * Return a table mapping [Folder]s to the [AnalysisContext]s associated with |
+ * them. |
+ */ |
+ Map<Folder, AnalysisContext> get folderMap; |
+ |
+ /** |
* Return the list of included paths (folders and files) most recently passed |
* to [setRoots]. |
*/ |
@@ -461,6 +473,13 @@ class ContextManagerImpl implements ContextManager { |
final ContextInfo rootInfo = new ContextInfo._root(); |
/** |
+ * A table mapping [Folder]s to the [AnalysisContext]s associated with them. |
+ */ |
+ @override |
+ final Map<Folder, AnalysisContext> folderMap = |
+ new HashMap<Folder, AnalysisContext>(); |
+ |
+ /** |
* The controller that is notified when we are starting or ending the |
* computation of a package map. |
*/ |
@@ -491,6 +510,9 @@ class ContextManagerImpl implements ContextManager { |
} |
@override |
+ Iterable<AnalysisContext> get analysisContexts => folderMap.values; |
+ |
+ @override |
List<AnalysisContext> contextsInAnalysisRoot(Folder analysisRoot) { |
List<AnalysisContext> contexts = <AnalysisContext>[]; |
ContextInfo innermostContainingInfo = |