OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library context.directory.manager; | 5 library context.directory.manager; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 import 'dart:core'; | 10 import 'dart:core'; |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 } | 1028 } |
1029 | 1029 |
1030 /** | 1030 /** |
1031 * Compute the set of files that are being flushed, this is defined as | 1031 * Compute the set of files that are being flushed, this is defined as |
1032 * the set of sources in the removed context (context.sources), that are | 1032 * the set of sources in the removed context (context.sources), that are |
1033 * orphaned by this context being removed (no other context includes this | 1033 * orphaned by this context being removed (no other context includes this |
1034 * file.) | 1034 * file.) |
1035 */ | 1035 */ |
1036 List<String> _computeFlushedFiles(ContextInfo info) { | 1036 List<String> _computeFlushedFiles(ContextInfo info) { |
1037 if (enableNewAnalysisDriver) { | 1037 if (enableNewAnalysisDriver) { |
1038 Set<String> flushedFiles = info.analysisDriver.knownFiles.toSet(); | 1038 Set<String> flushedFiles = info.analysisDriver.addedFiles.toSet(); |
1039 for (ContextInfo contextInfo in rootInfo.descendants) { | 1039 for (ContextInfo contextInfo in rootInfo.descendants) { |
1040 AnalysisDriver other = contextInfo.analysisDriver; | 1040 AnalysisDriver other = contextInfo.analysisDriver; |
1041 if (other != info.analysisDriver) { | 1041 if (other != info.analysisDriver) { |
1042 flushedFiles.removeAll(other.knownFiles); | 1042 flushedFiles.removeAll(other.addedFiles); |
1043 } | 1043 } |
1044 } | 1044 } |
1045 return flushedFiles.toList(growable: false); | 1045 return flushedFiles.toList(growable: false); |
1046 } else { | 1046 } else { |
1047 AnalysisContext context = info.context; | 1047 AnalysisContext context = info.context; |
1048 HashSet<String> flushedFiles = new HashSet<String>(); | 1048 HashSet<String> flushedFiles = new HashSet<String>(); |
1049 for (Source source in context.sources) { | 1049 for (Source source in context.sources) { |
1050 flushedFiles.add(source.fullName); | 1050 flushedFiles.add(source.fullName); |
1051 } | 1051 } |
1052 for (ContextInfo contextInfo in rootInfo.descendants) { | 1052 for (ContextInfo contextInfo in rootInfo.descendants) { |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 } | 1946 } |
1947 return _embedderLocator; | 1947 return _embedderLocator; |
1948 } | 1948 } |
1949 | 1949 |
1950 @override | 1950 @override |
1951 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { | 1951 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
1952 return _sdkExtensionFinder ??= | 1952 return _sdkExtensionFinder ??= |
1953 new SdkExtensionFinder(buildPackageMap(resourceProvider)); | 1953 new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
1954 } | 1954 } |
1955 } | 1955 } |
OLD | NEW |