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 816876424f2e2d8c63c3523ace3782cad91a75e1..05c36d6c45d38825930c9ff3ee20459e972e79d9 100644 |
--- a/pkg/analysis_server/lib/src/analysis_server.dart |
+++ b/pkg/analysis_server/lib/src/analysis_server.dart |
@@ -1242,6 +1242,11 @@ class ServerContextManager extends ContextManager { |
if (context != null) { |
context.applyChanges(changeSet); |
analysisServer.schedulePerformAnalysisOperation(context); |
+ List<String> flushedFiles = new List<String>(); |
+ for (Source source in changeSet.removedSources) { |
+ flushedFiles.add(source.fullName); |
+ } |
+ sendAnalysisNotificationFlushResults(analysisServer, flushedFiles); |
} |
} |
@@ -1258,9 +1263,17 @@ class ServerContextManager extends ContextManager { |
@override |
void removeContext(Folder folder) { |
AnalysisContext context = analysisServer.folderMap.remove(folder); |
+ |
+ // See dartbug.com/22689, the AnalysisContext is computed in |
+ // computeFlushedFiles instead of using the referenced context above, this |
+ // is an attempt to be careful concerning the referenced issue. |
+ List<String> flushedFiles = computeFlushedFiles(folder); |
+ sendAnalysisNotificationFlushResults(analysisServer, flushedFiles); |
+ |
if (analysisServer.index != null) { |
analysisServer.index.removeContext(context); |
} |
+ analysisServer.operationQueue.contextRemoved(context); |
_onContextsChangedController |
.add(new ContextsChangedEvent(removed: [context])); |
analysisServer.sendContextAnalysisDoneNotifications( |