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

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

Issue 2571593002: Support for overlay only files in Analysis Server with the new driver. (Closed)
Patch Set: Created 4 years 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 8bbadccbfe05d26f957784f79d4fb3257ccb1f6e..5f4460ca3e5f6f8e2f437c4b729bdc4b67ed126c 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -279,6 +279,17 @@ abstract class ContextManager {
List<AnalysisContext> contextsInAnalysisRoot(Folder analysisRoot);
/**
+ * Return the [AnalysisDriver] for the "innermost" context whose associated
+ * folder is or contains the given path. ("innermost" refers to the nesting
+ * of contexts, so if there is a context for path /foo and a context for
+ * path /foo/bar, then the innermost context containing /foo/bar/baz.dart is
+ * the context for /foo/bar.)
+ *
+ * If no driver contains the given path, `null` is returned.
+ */
+ AnalysisDriver getDriverFor(String path);
+
+ /**
* Return the [AnalysisContext] for the "innermost" context whose associated
* folder is or contains the given path. ("innermost" refers to the nesting
* of contexts, so if there is a context for path /foo and a context for
@@ -583,6 +594,11 @@ class ContextManagerImpl implements ContextManager {
bool definesEmbeddedLibs(Map map) => map[_EMBEDDED_LIB_MAP_KEY] != null;
@override
+ AnalysisDriver getDriverFor(String path) {
+ return _getInnermostContextInfoFor(path)?.analysisDriver;
+ }
+
+ @override
AnalysisContext getContextFor(String path) {
return _getInnermostContextInfoFor(path)?.context;
}

Powered by Google App Engine
This is Rietveld 408576698