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

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

Issue 2559523005: Remove the AnalysisOptionsProcessor (Closed)
Patch Set: Created 4 years 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/plugin/options.dart ('k') | pkg/analyzer/lib/src/plugin/options_plugin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/builder.dart
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index 50379950fe16d447e4a0c55ead8093ace729b6f2..95b94651b31d37cec9e7b618a2aedf2742ea854d 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -9,7 +9,6 @@ import 'dart:core';
import 'package:analyzer/context/declared_variables.dart';
import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/plugin/options.dart';
import 'package:analyzer/plugin/resolver_provider.dart';
import 'package:analyzer/source/analysis_options_provider.dart';
import 'package:analyzer/source/package_map_resolver.dart';
@@ -102,7 +101,7 @@ class ContextBuilder {
AnalysisContext buildContext(String path) {
InternalAnalysisContext context =
AnalysisEngine.instance.createAnalysisContext();
- AnalysisOptions options = getAnalysisOptions(context, path);
+ AnalysisOptions options = getAnalysisOptions(path);
context.contentCache = contentCache;
context.sourceFactory = createSourceFactory(path, options);
context.analysisOptions = options;
@@ -325,15 +324,13 @@ class ContextBuilder {
}
/**
- * Return the analysis options that should be used when the given [context] is
- * used to analyze code in the directory with the given [path].
+ * Return the analysis options that should be used to analyze code in the
+ * directory with the given [path].
*/
- AnalysisOptions getAnalysisOptions(AnalysisContext context, String path) {
+ AnalysisOptions getAnalysisOptions(String path) {
AnalysisOptionsImpl options = createDefaultOptions();
File optionsFile = getOptionsFile(path);
if (optionsFile != null) {
- List<OptionsProcessor> optionsProcessors =
- AnalysisEngine.instance.optionsPlugin.optionsProcessors;
// TODO(danrubel) restructure so that we don't recalculate the package map
// more than once per path.
Packages packages = createPackageMap(path);
@@ -348,11 +345,9 @@ class ContextBuilder {
Map<String, YamlNode> optionMap =
new AnalysisOptionsProvider(sourceFactory)
.getOptionsFromFile(optionsFile);
- optionsProcessors.forEach(
- (OptionsProcessor p) => p.optionsProcessed(context, optionMap));
applyToAnalysisOptions(options, optionMap);
- } on Exception catch (exception) {
- optionsProcessors.forEach((OptionsProcessor p) => p.onError(exception));
+ } catch (_) {
+ // Ignore exceptions thrown while trying to load the options file.
}
}
return options;
« no previous file with comments | « pkg/analyzer/lib/plugin/options.dart ('k') | pkg/analyzer/lib/src/plugin/options_plugin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698