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

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

Issue 987143002: Fix for dartbug.com/22656- analysis.flushedResults implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/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 8af64b3f40d93bef9ec327223660860c200bfc75..15d204aab784efb77494e8df71dbba53c9232852 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -114,6 +114,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;
+ List<String> flushedFiles = new List<String>();
+ for (Source source in context.sources) {
+ flushedFiles.add(source.fullName);
+ }
+ for (_ContextInfo contextInfo in _contexts.values) {
+ AnalysisContext contextN = contextInfo.context;
+ for (Source source in contextN.sources) {
+ if (context != contextN) {
Brian Wilkerson 2015/03/09 18:56:09 Can we move the 'for' loop inside the 'if'? Doing
jwren 2015/03/09 19:55:14 Fixed
+ flushedFiles.remove(source.fullName);
+ }
+ }
+ }
+ return flushedFiles;
+ }
+
+ /**
* 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_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698