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

Unified Diff: lib/src/plugin/linter_plugin.dart

Issue 1968603002: Update to use the new version of plugin (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: 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 | « no previous file | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/plugin/linter_plugin.dart
diff --git a/lib/src/plugin/linter_plugin.dart b/lib/src/plugin/linter_plugin.dart
index e2a44c99b35a0c5213806a217bca829682d40e29..4e943cf4a23010f65c137b51651b2971740745b7 100644
--- a/lib/src/plugin/linter_plugin.dart
+++ b/lib/src/plugin/linter_plugin.dart
@@ -40,7 +40,7 @@ class LinterPlugin implements Plugin {
static const String LINT_RULE_EXTENSION_POINT = 'rule';
/// The extension point that allows plugins to register new lint rules.
- ExtensionPoint lintRuleExtensionPoint;
+ ExtensionPoint<LintRule> lintRuleExtensionPoint;
/// An options processor for creating lint configs from analysis options.
AnalysisOptionsProcessor _optionsProcessor;
@@ -68,8 +68,9 @@ class LinterPlugin implements Plugin {
@override
void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
- lintRuleExtensionPoint = registerExtensionPoint(
- LINT_RULE_EXTENSION_POINT, _validateTaskExtension);
+ lintRuleExtensionPoint =
+ new ExtensionPoint<LintRule>(this, LINT_RULE_EXTENSION_POINT, null);
+ registerExtensionPoint(lintRuleExtensionPoint);
}
@override
@@ -101,11 +102,4 @@ class LinterPlugin implements Plugin {
List<Linter> _getRules(LintConfig config) =>
config != null ? ruleRegistry.enabled(config).toList() : _noLints;
-
- void _validateTaskExtension(Object extension) {
- if (extension is! LintRule) {
- String id = lintRuleExtensionPoint.uniqueIdentifier;
- throw new ExtensionError('Extensions to $id must implement LintRule');
- }
- }
}
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698