mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[analyzer] minor updates to the quick_fix.md documentation
The changes are: * Use the current tear-off syntax for constuctors in the example * Add references to the code where certain maps are defined. Change-Id: I5710090c1ecb2939d74a3822b8c7b35090be378c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304323 Commit-Queue: Sigmund Cherem <sigmund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
eb8e3d549a
commit
cc8b3f792e
|
@ -207,14 +207,14 @@ The list of fixes is computed by a `FixProcessor`. For each diagnostic passed
|
|||
to it, it will look up the diagnostic in a table to get a list of the correction
|
||||
producers it can use to produce fixes. There are three tables:
|
||||
|
||||
- The `lintProducerMap` is used for fixes related to lint rules. The table is
|
||||
keyed by the name of the lint to which the fix applies.
|
||||
- The [`lintProducerMap`][lintmap] is used for fixes related to lint rules. The
|
||||
table is keyed by the name of the lint to which the fix applies.
|
||||
|
||||
- The `nonLintProducerMap` is used for all other fixes. The table is keyed by
|
||||
the `ErrorCode` associated with the diagnostic.
|
||||
- The [`nonLintProducerMap`][nonlintmap] is used for all other fixes. The table
|
||||
is keyed by the `ErrorCode` associated with the diagnostic.
|
||||
|
||||
- The `nonLintMultiProducerMap` is used for multi-producers, which are
|
||||
described below in "Multi-fix producers".
|
||||
- The [`nonLintMultiProducerMap`][multimap] is used for multi-producers, which
|
||||
are described below in "Multi-fix producers".
|
||||
|
||||
Actually, the tables contain lists of functions used to create the producers. We
|
||||
do that so that producers can't accidentally carry state over from one use to
|
||||
|
@ -226,7 +226,7 @@ you're adding a fix for a lint, then you'd add an entry like
|
|||
|
||||
```dart
|
||||
LintNames.could_be_final: [
|
||||
AddFinal.newInstance,
|
||||
AddFinal.new,
|
||||
],
|
||||
```
|
||||
|
||||
|
@ -562,3 +562,7 @@ will be identical in nature to those written to test the fix-in-file use case,
|
|||
but will be in a subclass of `BulkFixProcessorTest`. They should also be added
|
||||
to the test file you created earlier for the single-site and fix-in-file fixes
|
||||
(`analysis_server/test/src/services/correction/fix/add_final_test.dart`).
|
||||
|
||||
[lintmap]: https://github.com/dart-lang/sdk/blob/cc461910af5f138bb54025e33f539835262b02bc/pkg/analysis_server/lib/src/services/correction/fix_internal.dart#L394
|
||||
[nonlintmap]: https://github.com/dart-lang/sdk/blob/cc461910af5f138bb54025e33f539835262b02bc/pkg/analysis_server/lib/src/services/correction/fix_internal.dart#L959
|
||||
[multimap]: https://github.com/dart-lang/sdk/blob/cc461910af5f138bb54025e33f539835262b02bc/pkg/analysis_server/lib/src/services/correction/fix_internal.dart#L791
|
||||
|
|
Loading…
Reference in a new issue