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

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 1750683002: Move folderMap from AnalysisContext to ContextManager (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/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 =

Powered by Google App Engine
This is Rietveld 408576698