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

Side by Side Diff: pkg/analyzer_plugin/doc/tutorial/fixes.md

Issue 2992843002: Add more documentation for plugins (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 # Providing Quick Fixes 1 # Providing Quick Fixes
2 2
3 A quick fix is used by clients to provide a set of possible changes to code that 3 A quick fix is used by clients to provide a set of possible changes to code that
4 are based on diagnostics reported against the code. Quick fixes are intended to 4 are based on diagnostics reported against the code. Quick fixes are intended to
5 help users resolve the issue being reported. 5 help users resolve the issue being reported.
6 6
7 If your plugin generates any diagnostics then you should consider providing 7 If your plugin generates any diagnostics then you should consider providing
8 support for automatically fixing those diagnostics. There is often more than one 8 support for automatically fixing those diagnostics. There is often more than one
9 potential way of fixing a given problem, so it is possible for your plugin to 9 potential way of fixing a given problem, so it is possible for your plugin to
10 provide multiple fixes for a single problem. 10 provide multiple fixes for a single problem.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 Given a contributor like the one above, you can implement your plugin similar to 106 Given a contributor like the one above, you can implement your plugin similar to
107 the following: 107 the following:
108 108
109 ```dart 109 ```dart
110 class MyPlugin extends ServerPlugin with FixesMixin, DartFixesMixin { 110 class MyPlugin extends ServerPlugin with FixesMixin, DartFixesMixin {
111 // ... 111 // ...
112 112
113 @override 113 @override
114 List<FixContributor> getFixContributors( 114 List<FixContributor> getFixContributors(
115 covariant AnalysisDriverGeneric driver) { 115 AnalysisDriverGeneric driver) {
116 return <FixContributor>[new MyFixContributor()]; 116 return <FixContributor>[new MyFixContributor()];
117 } 117 }
118 } 118 }
119 ``` 119 ```
120 120
121 [creatingEdits]: creating_edits.md 121 [creatingEdits]: creating_edits.md
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698