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

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

Issue 1008443002: Cherry-pick r44373, r44378, and r44275. (Closed) Base URL: https://dart.googlecode.com/svn/trunk/dart
Patch Set: 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 ec26ccbfb3744bd5383cf250edf581460c3000cd..d715b6b848a4d6f0fbb424492f8d01c80334790b 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -115,6 +115,29 @@ abstract class ContextManager {
}
/**
+ * Compute the set of files that are being flushed, this is defined as
+ * the set of sources in the removed context (context.sources), that are
+ * orphaned by this context being removed (no other context includes this
+ * file.)
+ */
+ List<String> computeFlushedFiles(Folder folder) {
+ AnalysisContext context = _contexts[folder].context;
+ HashSet<String> flushedFiles = new HashSet<String>();
+ for (Source source in context.sources) {
+ flushedFiles.add(source.fullName);
+ }
+ for (_ContextInfo contextInfo in _contexts.values) {
+ AnalysisContext contextN = contextInfo.context;
+ if (context != contextN) {
+ for (Source source in contextN.sources) {
+ flushedFiles.remove(source.fullName);
+ }
+ }
+ }
+ return flushedFiles.toList(growable:false);
+ }
+
+ /**
* We have finished computing the package map.
*/
void endComputePackageMap() {
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/operation/operation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698