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

Unified Diff: pkg/analyzer_plugin/doc/tutorial/getting_started.md

Issue 2973753003: Initial documentation for the plugin package (Closed)
Patch Set: Created 3 years, 5 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
Index: pkg/analyzer_plugin/doc/tutorial/getting_started.md
diff --git a/pkg/analyzer_plugin/doc/tutorial/getting_started.md b/pkg/analyzer_plugin/doc/tutorial/getting_started.md
new file mode 100644
index 0000000000000000000000000000000000000000..5352c9fce3723c405fa17f0cbd678ec9b21fb4df
--- /dev/null
+++ b/pkg/analyzer_plugin/doc/tutorial/getting_started.md
@@ -0,0 +1,39 @@
+# Getting Started
+
+## Creating a Minimal Plugin
+
+To implement a plugin, start by creating a simple package and create a class
+that is a subclass of `ServerPlugin`. This class will need to implement a
+constructor, three getters, and two methods. The getters provide some basic
+information about your plugin: the name and version, both of which are included
+in error messages if there is a problem encountered, and a list of glob patterns
+for the files that the plugin cares about. The methods ...
+
+Here's an example of what a minimal plugin might look like.
+
+```dart
+class MyPlugin extends ServerPlugin {
+ MyPlugin(ResourceProvider provider) : super(provider);
+
+ @override
+ List<String> get fileGlobsToAnalyze => <String>['**/*.dart'];
+
+ @override
+ String get name => 'My fantastic plugin';
+
+ @override
+ String get version => '1.0.0';
+
+ @override
+ AnalysisDriverGeneric createAnalysisDriver(ContextRoot contextRoot) {
+ // TODO: implement createAnalysisDriver
+ return null;
+ }
+
+ @override
+ void sendNotificationsForSubscriptions(
+ Map<String, List<AnalysisService>> subscriptions) {
+ // TODO: implement sendNotificationsForSubscriptions
+ }
+}
+```

Powered by Google App Engine
This is Rietveld 408576698