| 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 ede7e98514f86c113fedf6b94058ee9ec6984e7b..b16e78201c69cdf26d8840764337e3080c0144ea 100644
|
| --- a/pkg/analysis_server/lib/src/context_manager.dart
|
| +++ b/pkg/analysis_server/lib/src/context_manager.dart
|
| @@ -279,26 +279,26 @@ abstract class ContextManager {
|
| List<AnalysisContext> contextsInAnalysisRoot(Folder analysisRoot);
|
|
|
| /**
|
| - * Return the [AnalysisDriver] for the "innermost" context whose associated
|
| + * 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
|
| * 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.
|
| + * If no context contains the given path, `null` is returned.
|
| */
|
| - AnalysisDriver getDriverFor(String path);
|
| + AnalysisContext getContextFor(String path);
|
|
|
| /**
|
| - * Return the [AnalysisContext] for the "innermost" context whose associated
|
| + * 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 context contains the given path, `null` is returned.
|
| + * If no driver contains the given path, `null` is returned.
|
| */
|
| - AnalysisContext getContextFor(String path);
|
| + AnalysisDriver getDriverFor(String path);
|
|
|
| /**
|
| * Return a list of all of the analysis drivers reachable from the given
|
| @@ -594,11 +594,6 @@ 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;
|
| }
|
| @@ -615,6 +610,11 @@ class ContextManagerImpl implements ContextManager {
|
| }
|
|
|
| @override
|
| + AnalysisDriver getDriverFor(String path) {
|
| + return _getInnermostContextInfoFor(path)?.analysisDriver;
|
| + }
|
| +
|
| + @override
|
| List<AnalysisDriver> getDriversInAnalysisRoot(Folder analysisRoot) {
|
| List<AnalysisDriver> drivers = <AnalysisDriver>[];
|
| void addContextAndDescendants(ContextInfo info) {
|
| @@ -1706,10 +1706,18 @@ class ContextManagerImpl implements ContextManager {
|
| }
|
|
|
| void _updateContextPackageUriResolver(Folder contextFolder) {
|
| - AnalysisContext context = folderMap[contextFolder];
|
| - context.sourceFactory =
|
| - _createSourceFactory(context, context.analysisOptions, contextFolder);
|
| - callbacks.updateContextPackageUriResolver(context);
|
| + if (enableNewAnalysisDriver) {
|
| + ContextInfo info = getContextInfoFor(contextFolder);
|
| + AnalysisDriver driver = info.analysisDriver;
|
| + SourceFactory sourceFactory =
|
| + _createSourceFactory(null, driver.analysisOptions, contextFolder);
|
| + driver.configure(sourceFactory: sourceFactory);
|
| + } else {
|
| + AnalysisContext context = folderMap[contextFolder];
|
| + context.sourceFactory =
|
| + _createSourceFactory(context, context.analysisOptions, contextFolder);
|
| + callbacks.updateContextPackageUriResolver(context);
|
| + }
|
| }
|
|
|
| /**
|
|
|