Chromium Code Reviews| 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() { |