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

Unified Diff: pkg/analysis_server/lib/src/analysis_server.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/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 6c7aae92c48bdb42885e76999a4b328fa638ca6f..12c6aa30b66dc07d8fff73363651bca3d686f628 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -1020,29 +1020,32 @@ class AnalysisServer {
overlayState.setContents(source, newContents);
// Update all contexts.
for (InternalAnalysisContext context in folderMap.values) {
- if (context.handleContentsChanged(
- source, oldContents, newContents, true)) {
- schedulePerformAnalysisOperation(context);
- } else {
- // When the client sends any change for a source, we should resend
- // subscribed notifications, even if there were no changes in the
- // source contents.
- // TODO(scheglov) consider checking if there are subscriptions.
- if (AnalysisEngine.isDartFileName(file)) {
- List<CompilationUnit> dartUnits =
- context.ensureResolvedDartUnits(source);
- if (dartUnits != null) {
- AnalysisErrorInfo errorInfo = context.getErrors(source);
- for (var dartUnit in dartUnits) {
- scheduleNotificationOperations(this, file, errorInfo.lineInfo,
- context, null, dartUnit, errorInfo.errors);
- scheduleIndexOperation(this, file, context, dartUnit);
+ List<Source> sources = context.getSourcesWithFullName(file);
+ sources.forEach((Source source) {
+ if (context.handleContentsChanged(
+ source, oldContents, newContents, true)) {
+ schedulePerformAnalysisOperation(context);
+ } else {
+ // When the client sends any change for a source, we should resend
+ // subscribed notifications, even if there were no changes in the
+ // source contents.
+ // TODO(scheglov) consider checking if there are subscriptions.
+ if (AnalysisEngine.isDartFileName(file)) {
+ List<CompilationUnit> dartUnits =
+ context.ensureResolvedDartUnits(source);
+ if (dartUnits != null) {
+ AnalysisErrorInfo errorInfo = context.getErrors(source);
+ for (var dartUnit in dartUnits) {
+ scheduleNotificationOperations(this, file, errorInfo.lineInfo,
+ context, null, dartUnit, errorInfo.errors);
+ scheduleIndexOperation(this, file, context, dartUnit);
+ }
+ } else {
+ schedulePerformAnalysisOperation(context);
}
- } else {
- schedulePerformAnalysisOperation(context);
}
}
- }
+ });
}
});
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/context_manager.dart » ('j') | pkg/analyzer/lib/src/generated/engine.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698