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/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 * not) being implicitly analyzed. | 197 * not) being implicitly analyzed. |
198 */ | 198 */ |
199 StreamController<ImplicitAnalysisEvent> _implicitAnalysisEventsController; | 199 StreamController<ImplicitAnalysisEvent> _implicitAnalysisEventsController; |
200 | 200 |
201 /** | 201 /** |
202 * The listeners that are to be notified when various analysis results are | 202 * The listeners that are to be notified when various analysis results are |
203 * produced in this context. | 203 * produced in this context. |
204 */ | 204 */ |
205 List<AnalysisListener> _listeners = new List<AnalysisListener>(); | 205 List<AnalysisListener> _listeners = new List<AnalysisListener>(); |
206 | 206 |
207 /** | |
208 * When we resynthesize SDK element model in the same context, we should | |
209 * not use a separate SDK cache partition. | |
Paul Berry
2017/01/23 22:36:45
I'm having trouble understanding which parts of th
scheglov
2017/01/23 22:44:49
Done.
| |
210 */ | |
211 bool useSdkCachePartition = true; | |
212 | |
207 @override | 213 @override |
208 ResultProvider resultProvider; | 214 ResultProvider resultProvider; |
209 | 215 |
210 /** | 216 /** |
211 * The map of [ResultChangedEvent] controllers. | 217 * The map of [ResultChangedEvent] controllers. |
212 */ | 218 */ |
213 final Map<ResultDescriptor, StreamController<ResultChangedEvent>> | 219 final Map<ResultDescriptor, StreamController<ResultChangedEvent>> |
214 _resultChangedControllers = | 220 _resultChangedControllers = |
215 <ResultDescriptor, StreamController<ResultChangedEvent>>{}; | 221 <ResultDescriptor, StreamController<ResultChangedEvent>>{}; |
216 | 222 |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
732 } | 738 } |
733 | 739 |
734 /** | 740 /** |
735 * Create an analysis cache based on the given source [factory]. | 741 * Create an analysis cache based on the given source [factory]. |
736 */ | 742 */ |
737 AnalysisCache createCacheFromSourceFactory(SourceFactory factory) { | 743 AnalysisCache createCacheFromSourceFactory(SourceFactory factory) { |
738 AnalysisCache createCache() { | 744 AnalysisCache createCache() { |
739 if (factory == null) { | 745 if (factory == null) { |
740 return new AnalysisCache(<CachePartition>[_privatePartition]); | 746 return new AnalysisCache(<CachePartition>[_privatePartition]); |
741 } | 747 } |
748 if (!useSdkCachePartition) { | |
749 return new AnalysisCache(<CachePartition>[_privatePartition]); | |
750 } | |
742 DartSdk sdk = factory.dartSdk; | 751 DartSdk sdk = factory.dartSdk; |
743 if (sdk == null) { | 752 if (sdk == null) { |
744 return new AnalysisCache(<CachePartition>[_privatePartition]); | 753 return new AnalysisCache(<CachePartition>[_privatePartition]); |
745 } | 754 } |
746 return new AnalysisCache(<CachePartition>[ | 755 return new AnalysisCache(<CachePartition>[ |
747 AnalysisEngine.instance.partitionManager.forSdk(sdk), | 756 AnalysisEngine.instance.partitionManager.forSdk(sdk), |
748 _privatePartition | 757 _privatePartition |
749 ]); | 758 ]); |
750 } | 759 } |
751 | 760 |
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2264 } | 2273 } |
2265 DartSdk sdk = factory.dartSdk; | 2274 DartSdk sdk = factory.dartSdk; |
2266 if (sdk == null) { | 2275 if (sdk == null) { |
2267 throw new ArgumentError( | 2276 throw new ArgumentError( |
2268 "The source factory for an SDK analysis context must have a DartUriRes olver"); | 2277 "The source factory for an SDK analysis context must have a DartUriRes olver"); |
2269 } | 2278 } |
2270 return new AnalysisCache( | 2279 return new AnalysisCache( |
2271 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 2280 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
2272 } | 2281 } |
2273 } | 2282 } |
OLD | NEW |