Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Unified Diff: pkg/analyzer/lib/src/context/context.dart

Issue 2522543007: Remove uses of configuration data (Closed)
Patch Set: clean-up Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/source/error_processor.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 528469662a3ac94ef96bafbe49b4492825d21d7d..30681763c31973b9a919793da3d10c78d72f944c 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -30,7 +30,6 @@ import 'package:analyzer/src/task/dart_work_manager.dart';
import 'package:analyzer/src/task/driver.dart';
import 'package:analyzer/src/task/incremental_element_builder.dart';
import 'package:analyzer/src/task/manager.dart';
-import 'package:analyzer/src/task/model.dart';
import 'package:analyzer/task/dart.dart';
import 'package:analyzer/task/general.dart';
import 'package:analyzer/task/html.dart';
@@ -38,13 +37,6 @@ import 'package:analyzer/task/model.dart';
import 'package:html/dom.dart' show Document;
/**
- * The descriptor used to associate exclude patterns with an analysis context in
- * configuration data.
- */
-final ListResultDescriptor<String> CONTEXT_EXCLUDES =
- new ListResultDescriptorImpl('CONTEXT_EXCLUDES', const <String>[]);
-
-/**
* Type of callback functions used by PendingFuture. Functions of this type
* should perform a computation based on the data in [entry] and return it. If
* the computation can't be performed yet because more analysis is needed,
@@ -281,8 +273,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
options.generateImplicitErrors ||
this._options.generateSdkErrors != options.generateSdkErrors ||
this._options.dart2jsHint != options.dart2jsHint ||
+ _notEqual(this._options.errorProcessors, options.errorProcessors) ||
+ _notEqual(this._options.excludePatterns, options.excludePatterns) ||
(this._options.hint && !options.hint) ||
(this._options.lint && !options.lint) ||
+ _notEqual(this._options.lintRules, options.lintRules) ||
this._options.preserveComments != options.preserveComments ||
this._options.strongMode != options.strongMode ||
this._options.enableAssertInitializer !=
@@ -322,11 +317,14 @@ class AnalysisContextImpl implements InternalAnalysisContext {
options.enableLazyAssignmentOperators;
this._options.enableSuperMixins = options.enableSuperMixins;
this._options.enableTiming = options.enableTiming;
+ this._options.errorProcessors = options.errorProcessors;
+ this._options.excludePatterns = options.excludePatterns;
this._options.hint = options.hint;
this._options.incremental = options.incremental;
this._options.incrementalApi = options.incrementalApi;
this._options.incrementalValidation = options.incrementalValidation;
this._options.lint = options.lint;
+ this._options.lintRules = options.lintRules;
this._options.preserveComments = options.preserveComments;
if (this._options.strongMode != options.strongMode) {
_typeSystem = null;
@@ -847,6 +845,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
return getResult(target, COMPILATION_UNIT_ELEMENT);
}
+ @deprecated
@override
Object/*=V*/ getConfigurationData/*<V>*/(ResultDescriptor/*<V>*/ key) =>
(_configurationData[key] ?? key?.defaultValue) as Object/*=V*/;
@@ -1307,6 +1306,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
}
+ @deprecated
@override
void setConfigurationData(ResultDescriptor key, Object data) {
_configurationData[key] = data;
@@ -1696,6 +1696,19 @@ class AnalysisContextImpl implements InternalAnalysisContext {
AnalysisEngine.instance.logger.logInformation(message);
}
+ bool _notEqual/*<T>*/(List/*<T>*/ first, List/*<T>*/ second) {
+ int length = first.length;
+ if (length != second.length) {
+ return true;
+ }
+ for (int i = 0; i < length; i++) {
+ if (first[i] != second[i]) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* Notify all of the analysis listeners that the errors associated with the
* given [source] has been updated to the given [errors].
« no previous file with comments | « pkg/analyzer/lib/source/error_processor.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698