| Index: packages/analyzer/lib/plugin/options.dart
|
| diff --git a/packages/analyzer/lib/plugin/options.dart b/packages/analyzer/lib/plugin/options.dart
|
| index fb99a5070f5717c71d3992c6967c9ed63f9857d5..632c4d955ec63b7bf72ba8b990a1198c446d32e7 100644
|
| --- a/packages/analyzer/lib/plugin/options.dart
|
| +++ b/packages/analyzer/lib/plugin/options.dart
|
| @@ -6,6 +6,7 @@
|
| /// analysis options file.
|
| library analyzer.plugin.options;
|
|
|
| +import 'package:analyzer/error/listener.dart';
|
| import 'package:analyzer/src/generated/engine.dart';
|
| import 'package:analyzer/src/plugin/options_plugin.dart';
|
| import 'package:plugin/plugin.dart';
|
| @@ -18,8 +19,17 @@ final String OPTIONS_PROCESSOR_EXTENSION_POINT_ID = Plugin.join(
|
| OptionsPlugin.UNIQUE_IDENTIFIER,
|
| OptionsPlugin.OPTIONS_PROCESSOR_EXTENSION_POINT);
|
|
|
| +/// The identifier of the extension point that allows plugins to validate
|
| +/// options defined in the analysis options file. The object used as an
|
| +/// extension must be an [OptionsValidator].
|
| +final String OPTIONS_VALIDATOR_EXTENSION_POINT_ID = Plugin.join(
|
| + OptionsPlugin.UNIQUE_IDENTIFIER,
|
| + OptionsPlugin.OPTIONS_VALIDATOR_EXTENSION_POINT);
|
| +
|
| /// Processes options defined in the analysis options file.
|
| ///
|
| +/// Clients may implement this class when implementing plugins.
|
| +///
|
| /// The options file format is intentionally very open-ended, giving clients
|
| /// utmost flexibility in defining their own options. The only hardfast
|
| /// expectation is that options files will contain a mapping from Strings
|
| @@ -59,5 +69,16 @@ abstract class OptionsProcessor {
|
| /// options have changed and to handle those changes appropriately. In
|
| /// addition to the [options] map, the associated analysis [context] is
|
| /// provided as well to allow for context-specific configuration.
|
| - void optionsProcessed(AnalysisContext context, Map<String, YamlNode> options);
|
| + void optionsProcessed(AnalysisContext context, Map<String, Object> options);
|
| +}
|
| +
|
| +/// Validates options as defined in an analysis options file.
|
| +///
|
| +/// Clients may implement this class when implementing plugins.
|
| +///
|
| +/// See [OptionsProcessor] for a description of the options file format.
|
| +///
|
| +abstract class OptionsValidator {
|
| + /// Validate [options], reporting any errors to the given [reporter].
|
| + void validate(ErrorReporter reporter, Map<String, YamlNode> options);
|
| }
|
|
|