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

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

Issue 981283003: Change all sources associated with changed files (issue 22680) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 5 years, 9 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 8af64b3f40d93bef9ec327223660860c200bfc75..616460e32b4614995fafd5b2ba8f2c9ec7ee5bc0 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -466,6 +466,10 @@ abstract class ContextManager {
}
void _handleWatchEvent(Folder folder, _ContextInfo info, WatchEvent event) {
+ // TODO(brianwilkerson) If a file is explicitly included in one context
+ // but implicitly referenced in another context, we will only send a
+ // changeSet to the context that explicitly includes the file (because
+ // that's the only context that's watching the file).
_instrumentationService.logWatchEvent(
folder.path, event.path, event.type.toString());
String path = event.path;
@@ -509,19 +513,23 @@ abstract class ContextManager {
_mergeContext(info);
return;
}
- Source source = info.sources[path];
- if (source != null) {
+ List<Source> sources = info.context.getSourcesWithFullName(path);
+ if (!sources.isEmpty) {
ChangeSet changeSet = new ChangeSet();
- changeSet.removedSource(source);
+ sources.forEach((Source source) {
+ changeSet.removedSource(source);
+ });
applyChangesToContext(folder, changeSet);
info.sources.remove(path);
}
break;
case ChangeType.MODIFY:
- Source source = info.sources[path];
- if (source != null) {
+ List<Source> sources = info.context.getSourcesWithFullName(path);
+ if (!sources.isEmpty) {
ChangeSet changeSet = new ChangeSet();
- changeSet.changedSource(source);
+ sources.forEach((Source source) {
+ changeSet.changedSource(source);
+ });
applyChangesToContext(folder, changeSet);
}
break;

Powered by Google App Engine
This is Rietveld 408576698