| 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 engine; | 5 library engine; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:math' as math; | 9 import 'dart:math' as math; |
| 10 | 10 |
| 11 import 'package:analyzer/source/embedder.dart'; |
| 11 import 'package:analyzer/src/cancelable_future.dart'; | 12 import 'package:analyzer/src/cancelable_future.dart'; |
| 12 import 'package:analyzer/src/context/cache.dart' as cache; | 13 import 'package:analyzer/src/context/cache.dart' as cache; |
| 13 import 'package:analyzer/src/context/context.dart' as newContext; | 14 import 'package:analyzer/src/context/context.dart' as newContext; |
| 14 import 'package:analyzer/src/generated/incremental_resolution_validator.dart'; | 15 import 'package:analyzer/src/generated/incremental_resolution_validator.dart'; |
| 15 import 'package:analyzer/src/plugin/command_line_plugin.dart'; | 16 import 'package:analyzer/src/plugin/command_line_plugin.dart'; |
| 16 import 'package:analyzer/src/plugin/engine_plugin.dart'; | 17 import 'package:analyzer/src/plugin/engine_plugin.dart'; |
| 17 import 'package:analyzer/src/plugin/options_plugin.dart'; | 18 import 'package:analyzer/src/plugin/options_plugin.dart'; |
| 18 import 'package:analyzer/src/services/lint.dart'; | 19 import 'package:analyzer/src/services/lint.dart'; |
| 19 import 'package:analyzer/src/task/manager.dart'; | 20 import 'package:analyzer/src/task/manager.dart'; |
| 20 import 'package:analyzer/task/dart.dart'; | 21 import 'package:analyzer/task/dart.dart'; |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 * Configuration data associated with this context. | 958 * Configuration data associated with this context. |
| 958 */ | 959 */ |
| 959 final HashMap<ResultDescriptor, Object> _configurationData = | 960 final HashMap<ResultDescriptor, Object> _configurationData = |
| 960 new HashMap<ResultDescriptor, Object>(); | 961 new HashMap<ResultDescriptor, Object>(); |
| 961 | 962 |
| 962 /** | 963 /** |
| 963 * The set of analysis options controlling the behavior of this context. | 964 * The set of analysis options controlling the behavior of this context. |
| 964 */ | 965 */ |
| 965 AnalysisOptionsImpl _options = new AnalysisOptionsImpl(); | 966 AnalysisOptionsImpl _options = new AnalysisOptionsImpl(); |
| 966 | 967 |
| 968 /// The embedder yaml locator for this context. |
| 969 EmbedderYamlLocator _embedderYamlLocator = new EmbedderYamlLocator(null); |
| 970 |
| 967 /** | 971 /** |
| 968 * A flag indicating whether errors related to implicitly analyzed sources | 972 * A flag indicating whether errors related to implicitly analyzed sources |
| 969 * should be generated and reported. | 973 * should be generated and reported. |
| 970 */ | 974 */ |
| 971 bool _generateImplicitErrors = true; | 975 bool _generateImplicitErrors = true; |
| 972 | 976 |
| 973 /** | 977 /** |
| 974 * A flag indicating whether errors related to sources in the SDK should be | 978 * A flag indicating whether errors related to sources in the SDK should be |
| 975 * generated and reported. | 979 * generated and reported. |
| 976 */ | 980 */ |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 new StreamController<ImplicitAnalysisEvent>.broadcast(); | 1153 new StreamController<ImplicitAnalysisEvent>.broadcast(); |
| 1150 } | 1154 } |
| 1151 | 1155 |
| 1152 @override | 1156 @override |
| 1153 AnalysisCache get analysisCache => _cache; | 1157 AnalysisCache get analysisCache => _cache; |
| 1154 | 1158 |
| 1155 @override | 1159 @override |
| 1156 AnalysisOptions get analysisOptions => _options; | 1160 AnalysisOptions get analysisOptions => _options; |
| 1157 | 1161 |
| 1158 @override | 1162 @override |
| 1163 EmbedderYamlLocator get embedderYamlLocator => _embedderYamlLocator; |
| 1164 |
| 1165 @override |
| 1159 void set analysisOptions(AnalysisOptions options) { | 1166 void set analysisOptions(AnalysisOptions options) { |
| 1160 bool needsRecompute = this._options.analyzeFunctionBodiesPredicate != | 1167 bool needsRecompute = this._options.analyzeFunctionBodiesPredicate != |
| 1161 options.analyzeFunctionBodiesPredicate || | 1168 options.analyzeFunctionBodiesPredicate || |
| 1162 this._options.generateImplicitErrors != | 1169 this._options.generateImplicitErrors != |
| 1163 options.generateImplicitErrors || | 1170 options.generateImplicitErrors || |
| 1164 this._options.generateSdkErrors != options.generateSdkErrors || | 1171 this._options.generateSdkErrors != options.generateSdkErrors || |
| 1165 this._options.dart2jsHint != options.dart2jsHint || | 1172 this._options.dart2jsHint != options.dart2jsHint || |
| 1166 (this._options.hint && !options.hint) || | 1173 (this._options.hint && !options.hint) || |
| 1167 this._options.preserveComments != options.preserveComments || | 1174 this._options.preserveComments != options.preserveComments || |
| 1168 this._options.strongMode != options.strongMode || | 1175 this._options.strongMode != options.strongMode || |
| (...skipping 8253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9422 List<AnalysisTarget> get priorityTargets; | 9429 List<AnalysisTarget> get priorityTargets; |
| 9423 | 9430 |
| 9424 /** | 9431 /** |
| 9425 * The partition that contains analysis results that are not shared with other | 9432 * The partition that contains analysis results that are not shared with other |
| 9426 * contexts. | 9433 * contexts. |
| 9427 * | 9434 * |
| 9428 * TODO(scheglov) add the type, once we have only one cache. | 9435 * TODO(scheglov) add the type, once we have only one cache. |
| 9429 */ | 9436 */ |
| 9430 dynamic get privateAnalysisCachePartition; | 9437 dynamic get privateAnalysisCachePartition; |
| 9431 | 9438 |
| 9439 /// Get the [EmbedderYamlLocator] for this context. |
| 9440 EmbedderYamlLocator get embedderYamlLocator; |
| 9441 |
| 9432 /** | 9442 /** |
| 9433 * A factory to override how [ResolverVisitor] is created. | 9443 * A factory to override how [ResolverVisitor] is created. |
| 9434 */ | 9444 */ |
| 9435 ResolverVisitorFactory get resolverVisitorFactory; | 9445 ResolverVisitorFactory get resolverVisitorFactory; |
| 9436 | 9446 |
| 9437 /** | 9447 /** |
| 9438 * Returns a statistics about this context. | 9448 * Returns a statistics about this context. |
| 9439 */ | 9449 */ |
| 9440 AnalysisContextStatistics get statistics; | 9450 AnalysisContextStatistics get statistics; |
| 9441 | 9451 |
| (...skipping 2671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12113 PendingFuture pendingFuture = | 12123 PendingFuture pendingFuture = |
| 12114 new PendingFuture<T>(_context, source, computeValue); | 12124 new PendingFuture<T>(_context, source, computeValue); |
| 12115 if (!pendingFuture.evaluate(sourceEntry)) { | 12125 if (!pendingFuture.evaluate(sourceEntry)) { |
| 12116 _context._pendingFutureSources | 12126 _context._pendingFutureSources |
| 12117 .putIfAbsent(source, () => <PendingFuture>[]) | 12127 .putIfAbsent(source, () => <PendingFuture>[]) |
| 12118 .add(pendingFuture); | 12128 .add(pendingFuture); |
| 12119 } | 12129 } |
| 12120 return pendingFuture.future; | 12130 return pendingFuture.future; |
| 12121 } | 12131 } |
| 12122 } | 12132 } |
| OLD | NEW |