Skip to content

Commit 6e9d3e9

Browse files
loic-sharmaantfitchgemini-code-assist[bot]
authored
Improve the Dart analyzer plugin docs (#7039)
--- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. - [x] This PR doesn't contain automatically generated corrections or text (Grammarly, LLMs, and similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn't use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide](https://github.com/dart-lang/site-www/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Code changes should generally follow the [Dart style guide](https://dart.dev/effective-dart) and use `dart format`. - Updates to [code excerpts](https://github.com/dart-lang/site-shared/blob/main/packages/excerpter) indicated by `<?code-excerpt` need to be updated in their source `.dart` file as well. </details> --------- Co-authored-by: Amanda Fitch <18406675+antfitch@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 918219d commit 6e9d3e9

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/content/tools/analyzer-plugins.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ which provides the core `Plugin` class.
135135
136136
dependencies:
137137
analysis_server_plugin: ^0.3.0
138+
analyzer_plugin: ^0.13.0
138139
analyzer: ^8.0.0
139140
```
140141

@@ -147,6 +148,9 @@ which provides the core `Plugin` class.
147148
final plugin = SimplePlugin();
148149
149150
class SimplePlugin extends Plugin {
151+
@override
152+
String get name => 'Simple plugin';
153+
150154
@override
151155
void register(PluginRegistry registry) {
152156
// Register diagnostics, quick fixes, and assists.
@@ -171,13 +175,19 @@ Key points:
171175
point for registering your custom analysis rules,
172176
quick fixes, and assists with the analyzer.
173177

178+
:::tip
179+
After you have made changes to your plugin, restart the Dart
180+
Analysis Server to see the effects.
181+
:::
182+
174183
### Implement plugin features
175184

176185
Once you have your basic plugin package set up,
177186
you can start adding custom functionality by
178-
implementing the `register` method.
179-
To learn more about implementing specific functionality,
180-
check out the following guides:
187+
implementing the `register` method.
188+
189+
Read the following guides to learn how to implement specific
190+
functionality:
181191

182192
* [Writing rules][]
183193
* [Writing fixes][]
@@ -189,6 +199,17 @@ check out the following guides:
189199
[Writing assists]: https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server_plugin/doc/writing_assists.md
190200
[Testing rules]: https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server_plugin/doc/testing_rules.md
191201

202+
Check the Dart Analysis Server for many examples of rules,
203+
fixes, and, assists:
204+
205+
* [Dart Analysis Server's rules][]
206+
* [Dart Analysis Server's fixes][]
207+
* [Dart Analysis Server's assists][]
208+
209+
[Dart Analysis Server's rules]: https://github.com/dart-lang/sdk/tree/main/pkg/linter/lib/src/rules
210+
[Dart Analysis Server's fixes]: https://github.com/dart-lang/sdk/tree/main/pkg/analysis_server/lib/src/services/correction/dart
211+
[Dart Analysis Server's assists]: https://github.com/dart-lang/sdk/tree/main/pkg/analysis_server/lib/src/services/correction/dart
212+
192213
### Debug a plugin
193214

194215
If your plugin is not working as expected,

0 commit comments

Comments
 (0)