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; |