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

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

Issue 1410553005: Introducing a lint server plugin. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | pkg/analysis_server/lib/src/server/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/plugin/linter_plugin.dart
diff --git a/pkg/analysis_server/lib/src/plugin/linter_plugin.dart b/pkg/analysis_server/lib/src/plugin/linter_plugin.dart
new file mode 100644
index 0000000000000000000000000000000000000000..07fb54e3ca17607408d62ac9d2f63afd5b1968fd
--- /dev/null
+++ b/pkg/analysis_server/lib/src/plugin/linter_plugin.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.src.plugin.linter_plugin;
+
+import 'package:analysis_server/src/services/linter/linter.dart';
+import 'package:analyzer/plugin/options.dart';
+import 'package:plugin/plugin.dart';
+
+/// The shared linter server plugin instance.
+final LinterServerPlugin linterServerPlugin = new LinterServerPlugin();
+
+/// A plugin that defines the extension points and extensions that enhance
+/// linting in the server.
+class LinterServerPlugin implements Plugin {
+ /// The unique identifier of this plugin.
+ static const String UNIQUE_IDENTIFIER = 'linter.server';
+
+ @override
+ String get uniqueIdentifier => UNIQUE_IDENTIFIER;
+
+ @override
+ void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
+ // None.
+ }
+
+ @override
+ void registerExtensions(RegisterExtension registerExtension) {
+ //
+ // Register options validators.
+ //
+ registerExtension(
+ OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new LinterRuleOptionsValidator());
+ }
+}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/server/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698