OLD | NEW |
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 Loading... |
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 |
OLD | NEW |