| Index: pkg/analysis_server/lib/src/operation/operation_analysis.dart
|
| diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
|
| index 8ea73ae7b7d175cf1a66a4377c4583dec6966f65..07a4fdc1e0c3f87c3c9531527cc064b16e093789 100644
|
| --- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
|
| +++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
|
| @@ -173,6 +173,16 @@ class PerformAnalysisOperation extends ServerOperation {
|
| ChangeNotice notice = notices[i];
|
| Source source = notice.source;
|
| String file = source.fullName;
|
| + // Only send notifications if the current context is the preferred
|
| + // context for the file. This avoids redundant notification messages
|
| + // being sent to the client (see dartbug.com/22210).
|
| + // TODO(paulberry): note that there is a small risk that this will cause
|
| + // notifications to be lost if the preferred context for a file changes
|
| + // while analysis is in progress (e.g. because the client sent an
|
| + // analysis.setAnalysisRoots message).
|
| + if (server.getAnalysisContext(file) != context) {
|
| + continue;
|
| + }
|
| // Dart
|
| CompilationUnit parsedDartUnit = notice.parsedDartUnit;
|
| CompilationUnit resolvedDartUnit = notice.resolvedDartUnit;
|
|
|