| 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'; |
| 11 import 'package:analyzer/plugin/task.dart'; | 11 import 'package:analyzer/plugin/task.dart'; |
| 12 import 'package:analyzer/source/embedder.dart'; |
| 12 import 'package:analyzer/src/cancelable_future.dart'; | 13 import 'package:analyzer/src/cancelable_future.dart'; |
| 13 import 'package:analyzer/src/context/cache.dart'; | 14 import 'package:analyzer/src/context/cache.dart'; |
| 14 import 'package:analyzer/src/generated/ast.dart'; | 15 import 'package:analyzer/src/generated/ast.dart'; |
| 15 import 'package:analyzer/src/generated/constant.dart'; | 16 import 'package:analyzer/src/generated/constant.dart'; |
| 16 import 'package:analyzer/src/generated/element.dart'; | 17 import 'package:analyzer/src/generated/element.dart'; |
| 17 import 'package:analyzer/src/generated/engine.dart' | 18 import 'package:analyzer/src/generated/engine.dart' |
| 18 hide | 19 hide |
| 19 AnalysisCache, | 20 AnalysisCache, |
| 20 CachePartition, | 21 CachePartition, |
| 21 SdkCachePartition, | 22 SdkCachePartition, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 * A client-provided name used to identify this context, or `null` if the | 75 * A client-provided name used to identify this context, or `null` if the |
| 75 * client has not provided a name. | 76 * client has not provided a name. |
| 76 */ | 77 */ |
| 77 String name; | 78 String name; |
| 78 | 79 |
| 79 /** | 80 /** |
| 80 * The set of analysis options controlling the behavior of this context. | 81 * The set of analysis options controlling the behavior of this context. |
| 81 */ | 82 */ |
| 82 AnalysisOptionsImpl _options = new AnalysisOptionsImpl(); | 83 AnalysisOptionsImpl _options = new AnalysisOptionsImpl(); |
| 83 | 84 |
| 85 /// The embedder yaml locator for this context. |
| 86 EmbedderYamlLocator _embedderYamlLocator = new EmbedderYamlLocator(null); |
| 87 |
| 84 /** | 88 /** |
| 85 * A flag indicating whether this context is disposed. | 89 * A flag indicating whether this context is disposed. |
| 86 */ | 90 */ |
| 87 bool _disposed = false; | 91 bool _disposed = false; |
| 88 | 92 |
| 89 /** | 93 /** |
| 90 * A cache of content used to override the default content of a source. | 94 * A cache of content used to override the default content of a source. |
| 91 */ | 95 */ |
| 92 ContentCache _contentCache = new ContentCache(); | 96 ContentCache _contentCache = new ContentCache(); |
| 93 | 97 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 new StreamController<ImplicitAnalysisEvent>.broadcast(); | 249 new StreamController<ImplicitAnalysisEvent>.broadcast(); |
| 246 } | 250 } |
| 247 | 251 |
| 248 @override | 252 @override |
| 249 AnalysisCache get analysisCache => _cache; | 253 AnalysisCache get analysisCache => _cache; |
| 250 | 254 |
| 251 @override | 255 @override |
| 252 AnalysisOptions get analysisOptions => _options; | 256 AnalysisOptions get analysisOptions => _options; |
| 253 | 257 |
| 254 @override | 258 @override |
| 259 EmbedderYamlLocator get embedderYamlLocator => _embedderYamlLocator; |
| 260 |
| 261 @override |
| 255 void set analysisOptions(AnalysisOptions options) { | 262 void set analysisOptions(AnalysisOptions options) { |
| 256 bool needsRecompute = this._options.analyzeFunctionBodiesPredicate != | 263 bool needsRecompute = this._options.analyzeFunctionBodiesPredicate != |
| 257 options.analyzeFunctionBodiesPredicate || | 264 options.analyzeFunctionBodiesPredicate || |
| 258 this._options.generateImplicitErrors != | 265 this._options.generateImplicitErrors != |
| 259 options.generateImplicitErrors || | 266 options.generateImplicitErrors || |
| 260 this._options.generateSdkErrors != options.generateSdkErrors || | 267 this._options.generateSdkErrors != options.generateSdkErrors || |
| 261 this._options.dart2jsHint != options.dart2jsHint || | 268 this._options.dart2jsHint != options.dart2jsHint || |
| 262 (this._options.hint && !options.hint) || | 269 (this._options.hint && !options.hint) || |
| 263 (this._options.lint && !options.lint) || | 270 (this._options.lint && !options.lint) || |
| 264 this._options.preserveComments != options.preserveComments || | 271 this._options.preserveComments != options.preserveComments || |
| (...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2141 DartSdk sdk = factory.dartSdk; | 2148 DartSdk sdk = factory.dartSdk; |
| 2142 if (sdk == null) { | 2149 if (sdk == null) { |
| 2143 throw new IllegalArgumentException( | 2150 throw new IllegalArgumentException( |
| 2144 "The source factory for an SDK analysis context must have a DartUriRes
olver"); | 2151 "The source factory for an SDK analysis context must have a DartUriRes
olver"); |
| 2145 } | 2152 } |
| 2146 return new AnalysisCache(<CachePartition>[ | 2153 return new AnalysisCache(<CachePartition>[ |
| 2147 AnalysisEngine.instance.partitionManager_new.forSdk(sdk) | 2154 AnalysisEngine.instance.partitionManager_new.forSdk(sdk) |
| 2148 ]); | 2155 ]); |
| 2149 } | 2156 } |
| 2150 } | 2157 } |
| OLD | NEW |