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

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

Issue 2570623002: Fix bug when packages file changes in new driver (Closed)
Patch Set: clear file state 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..4a281b7cd25b35d8916bf8c963e9434464862318 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -988,14 +988,14 @@ class ContextManagerImpl implements ContextManager {
String path, ContextInfo info, ChangeType changeType) {
if (AnalysisEngine.isAnalysisOptionsFileName(path, pathContext)) {
if (enableNewAnalysisDriver) {
- // TODO(brianwilkerson) Implement this.
-// AnalysisDriver driver = info.analysisDriver;
-// String contextRoot = info.folder.path;
-// ContextBuilder builder =
-// callbacks.createContextBuilder(info.folder, defaultContextOptions);
-// AnalysisOptions options = builder.getAnalysisOptions(contextRoot);
-// driver.analysisOptions = options;
-// driver.sourceFactory = builder.createSourceFactory(contextRoot, options);
+ AnalysisDriver driver = info.analysisDriver;
+ String contextRoot = info.folder.path;
+ ContextBuilder builder =
+ callbacks.createContextBuilder(info.folder, defaultContextOptions);
+ AnalysisOptions options = builder.getAnalysisOptions(contextRoot);
+ SourceFactory factory =
+ builder.createSourceFactory(contextRoot, options);
+ driver.configure(analysisOptions: options, sourceFactory: factory);
// TODO(brianwilkerson) Set exclusion patterns.
} else {
var analysisContext = info.context;
@@ -1022,8 +1022,13 @@ class ContextManagerImpl implements ContextManager {
callbacks.createContextBuilder(info.folder, defaultContextOptions);
AnalysisOptions options = builder.getAnalysisOptions(contextRoot);
SourceFactory factory = builder.createSourceFactory(contextRoot, options);
- info.context.analysisOptions = options;
- info.context.sourceFactory = factory;
+ if (enableNewAnalysisDriver) {
+ AnalysisDriver driver = info.analysisDriver;
+ driver.configure(analysisOptions: options, sourceFactory: factory);
+ } else {
+ info.context.analysisOptions = options;
+ info.context.sourceFactory = factory;
+ }
}
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | pkg/analyzer/lib/src/dart/analysis/driver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698