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

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

Issue 332383006: Trigger re-analysis when a file changes on disk. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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_directory_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_directory_manager.dart b/pkg/analysis_server/lib/src/context_directory_manager.dart
index 20f51e597aed05dd5539071e08fc54a90b620e0e..7abfda8b3c479256453c9b8bc4e36e5afa996b31 100644
--- a/pkg/analysis_server/lib/src/context_directory_manager.dart
+++ b/pkg/analysis_server/lib/src/context_directory_manager.dart
@@ -134,7 +134,19 @@ abstract class ContextDirectoryManager {
}
break;
case ChangeType.MODIFY:
- // TODO(paulberry): handle modification events
+ Source source = info.sources[event.path];
+ if (source != null) {
+ ChangeSet changeSet = new ChangeSet();
+ // TODO(paulberry): technically we should skip calling changedSource()
+ // for files that currently have their contents overridden. However,
+ // it's hard to figure out which files have their contents overridden
+ // (this info isn't exposed through the AnalysisContext interface),
+ // and besides, if we go ahead and call changedSource() we get the
+ // behavior we want (the context continues consulting the overridden
+ // file contents).
+ changeSet.changedSource(source);
+ applyChangesToContext(folder, changeSet);
+ }
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698