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

Unified Diff: pkg/analyzer/lib/src/plugin/options_plugin.dart

Issue 1965083002: Update to use the latest version of the plugin package (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Patch version info Created 4 years, 7 months 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/src/plugin/engine_plugin.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/plugin/options_plugin.dart
diff --git a/pkg/analyzer/lib/src/plugin/options_plugin.dart b/pkg/analyzer/lib/src/plugin/options_plugin.dart
index 9a4fc01386ec592e2e39d23134ac6aa3004a2134..aceaf3b6815ae96b610252ce3b9476a971280d9e 100644
--- a/pkg/analyzer/lib/src/plugin/options_plugin.dart
+++ b/pkg/analyzer/lib/src/plugin/options_plugin.dart
@@ -26,31 +26,31 @@ class OptionsPlugin implements Plugin {
/// The extension point that allows plugins to register new options
/// processors.
- ExtensionPoint optionsProcessorExtensionPoint;
+ ExtensionPoint<OptionsProcessor> optionsProcessorExtensionPoint;
/// The extension point that allows plugins to register new options
/// validators.
- ExtensionPoint optionsValidatorExtensionPoint;
+ ExtensionPoint<OptionsValidator> optionsValidatorExtensionPoint;
/// All contributed options processors.
List<OptionsProcessor> get optionsProcessors =>
- optionsProcessorExtensionPoint?.extensions as List<OptionsProcessor> ??
- const <OptionsProcessor>[];
+ optionsProcessorExtensionPoint?.extensions ?? const <OptionsProcessor>[];
/// All contributed options validators.
List<OptionsValidator> get optionsValidators =>
- optionsValidatorExtensionPoint?.extensions as List<OptionsValidator> ??
- const <OptionsValidator>[];
+ optionsValidatorExtensionPoint?.extensions ?? const <OptionsValidator>[];
@override
String get uniqueIdentifier => UNIQUE_IDENTIFIER;
@override
void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
- optionsProcessorExtensionPoint = registerExtensionPoint(
- OPTIONS_PROCESSOR_EXTENSION_POINT, _validateOptionsProcessorExtension);
- optionsValidatorExtensionPoint = registerExtensionPoint(
- OPTIONS_VALIDATOR_EXTENSION_POINT, _validateOptionsValidatorExtension);
+ optionsProcessorExtensionPoint = new ExtensionPoint<OptionsProcessor>(
+ this, OPTIONS_PROCESSOR_EXTENSION_POINT, null);
+ registerExtensionPoint(optionsProcessorExtensionPoint);
+ optionsValidatorExtensionPoint = new ExtensionPoint<OptionsValidator>(
+ this, OPTIONS_VALIDATOR_EXTENSION_POINT, null);
+ registerExtensionPoint(optionsValidatorExtensionPoint);
}
@override
@@ -62,22 +62,4 @@ class OptionsPlugin implements Plugin {
registerExtension(
OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new AnalyzerOptionsValidator());
}
-
- /// Validate the given extension by throwing an [ExtensionError] if it is not
- /// a valid options processor.
- void _validateOptionsProcessorExtension(Object extension) {
- if (extension is! OptionsProcessor) {
- String id = optionsProcessorExtensionPoint.uniqueIdentifier;
- throw new ExtensionError('Extensions to $id must be an OptionsProcessor');
- }
- }
-
- /// Validate the given extension by throwing an [ExtensionError] if it is not
- /// a valid options validator.
- void _validateOptionsValidatorExtension(Object extension) {
- if (extension is! OptionsValidator) {
- String id = optionsValidatorExtensionPoint.uniqueIdentifier;
- throw new ExtensionError('Extensions to $id must be an OptionsValidator');
- }
- }
}
« no previous file with comments | « pkg/analyzer/lib/src/plugin/engine_plugin.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698