Chromium Code Reviews| Index: pkg/analyzer/lib/src/generated/engine.dart |
| diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart |
| index 743353abe9b5ce9bf7f0ba90d746fa6b900bbc05..8bfae7150de40c98c42728d28e01c6733de36cc5 100644 |
| --- a/pkg/analyzer/lib/src/generated/engine.dart |
| +++ b/pkg/analyzer/lib/src/generated/engine.dart |
| @@ -2253,6 +2253,24 @@ class AnalysisContextImpl implements InternalAnalysisContext { |
| return changed; |
| } |
| + /** |
| + * Invalidates hints in the given [librarySource]. |
| + */ |
| + void invalidateLibraryHints(Source librarySource) { |
|
Brian Wilkerson
2015/02/05 21:55:59
This needs to iterate over all of the parts in the
scheglov
2015/02/05 22:06:27
Done.
|
| + SourceEntry sourceEntry = _cache.get(librarySource); |
| + if (sourceEntry is! DartEntry) { |
| + return; |
| + } |
| + DartEntry dartEntry = sourceEntry; |
| + if (dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource) == |
| + CacheState.VALID) { |
| + dartEntry.setStateInLibrary( |
| + DartEntry.HINTS, |
| + librarySource, |
| + CacheState.INVALID); |
| + } |
| + } |
| + |
| @override |
| bool isClientLibrary(Source librarySource) { |
| SourceEntry sourceEntry = _getReadableSourceEntry(librarySource); |
| @@ -5070,19 +5088,9 @@ class AnalysisContextImpl implements InternalAnalysisContext { |
| if (libraryElement == null) { |
| return false; |
| } |
| - // prepare the existing library units |
| - Map<Source, CompilationUnit> units = <Source, CompilationUnit>{}; |
| - for (CompilationUnitElement unitElement in libraryElement.units) { |
| - Source unitSource = unitElement.source; |
| - CompilationUnit unit = |
| - getResolvedCompilationUnit2(unitSource, librarySource); |
| - if (unit == null) { |
| - return false; |
| - } |
| - units[unitSource] = unit; |
| - } |
| // prepare the existing unit |
| - CompilationUnit oldUnit = units[unitSource]; |
| + CompilationUnit oldUnit = |
| + getResolvedCompilationUnit2(unitSource, librarySource); |
| if (oldUnit == null) { |
| return false; |
| } |
| @@ -5090,9 +5098,9 @@ class AnalysisContextImpl implements InternalAnalysisContext { |
| Stopwatch perfCounter = new Stopwatch()..start(); |
| PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver( |
| typeProvider, |
| - units, |
| unitSource, |
| dartEntry, |
| + oldUnit, |
| analysisOptions.incrementalApi); |
| bool success = resolver.resolve(newCode); |
| AnalysisEngine.instance.instrumentationService.logPerformance( |
| @@ -5110,14 +5118,13 @@ class AnalysisContextImpl implements InternalAnalysisContext { |
| incrementalResolutionValidation_lastUnit = oldUnit; |
| return false; |
| } |
| - // prepare notices |
| - units.forEach((Source source, CompilationUnit unit) { |
| - DartEntry dartEntry = _cache.get(source); |
| - LineInfo lineInfo = getLineInfo(source); |
| - ChangeNoticeImpl notice = _getNotice(source); |
| - notice.resolvedDartUnit = unit; |
| + // prepare notice |
| + { |
| + LineInfo lineInfo = getLineInfo(unitSource); |
| + ChangeNoticeImpl notice = _getNotice(unitSource); |
| + notice.resolvedDartUnit = oldUnit; |
| notice.setErrors(dartEntry.allErrors, lineInfo); |
| - }); |
| + } |
| // OK |
| return true; |
| } |
| @@ -9640,7 +9647,6 @@ class IncrementalAnalysisTask extends AnalysisTask { |
| LibraryElement library = element.library; |
| if (library != null) { |
| IncrementalResolver resolver = new IncrementalResolver( |
| - <Source, CompilationUnit>{}, |
| element, |
| cache.offset, |
| cache.oldLength, |