OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.src.context.context; | 5 library analyzer.src.context.context; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/instrumentation/instrumentation.dart'; | 10 import 'package:analyzer/instrumentation/instrumentation.dart'; |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 @override | 689 @override |
690 void dispose() { | 690 void dispose() { |
691 _disposed = true; | 691 _disposed = true; |
692 for (List<PendingFuture> pendingFutures in _pendingFutureTargets.values) { | 692 for (List<PendingFuture> pendingFutures in _pendingFutureTargets.values) { |
693 for (PendingFuture pendingFuture in pendingFutures) { | 693 for (PendingFuture pendingFuture in pendingFutures) { |
694 pendingFuture.forciblyComplete(); | 694 pendingFuture.forciblyComplete(); |
695 } | 695 } |
696 } | 696 } |
697 _pendingFutureTargets.clear(); | 697 _pendingFutureTargets.clear(); |
698 _privatePartition.dispose(); | 698 _privatePartition.dispose(); |
| 699 _cache.dispose(); |
699 } | 700 } |
700 | 701 |
701 @override | 702 @override |
702 List<CompilationUnit> ensureResolvedDartUnits(Source unitSource) { | 703 List<CompilationUnit> ensureResolvedDartUnits(Source unitSource) { |
703 // Check every library. | 704 // Check every library. |
704 List<CompilationUnit> units = <CompilationUnit>[]; | 705 List<CompilationUnit> units = <CompilationUnit>[]; |
705 List<Source> containingLibraries = getLibrariesContaining(unitSource); | 706 List<Source> containingLibraries = getLibrariesContaining(unitSource); |
706 for (Source librarySource in containingLibraries) { | 707 for (Source librarySource in containingLibraries) { |
707 LibrarySpecificUnit target = | 708 LibrarySpecificUnit target = |
708 new LibrarySpecificUnit(librarySource, unitSource); | 709 new LibrarySpecificUnit(librarySource, unitSource); |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 DartSdk sdk = factory.dartSdk; | 2129 DartSdk sdk = factory.dartSdk; |
2129 if (sdk == null) { | 2130 if (sdk == null) { |
2130 throw new IllegalArgumentException( | 2131 throw new IllegalArgumentException( |
2131 "The source factory for an SDK analysis context must have a DartUriRes
olver"); | 2132 "The source factory for an SDK analysis context must have a DartUriRes
olver"); |
2132 } | 2133 } |
2133 return new AnalysisCache(<CachePartition>[ | 2134 return new AnalysisCache(<CachePartition>[ |
2134 AnalysisEngine.instance.partitionManager_new.forSdk(sdk) | 2135 AnalysisEngine.instance.partitionManager_new.forSdk(sdk) |
2135 ]); | 2136 ]); |
2136 } | 2137 } |
2137 } | 2138 } |
OLD | NEW |