sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Dart fix cannot always convert doc comments

Open vsmenon opened this issue 3 years ago • 3 comments

With an SDK checkout, running:

cd samples-dev/swarm dart fix --apply .

doesn't catch the case here: https://dart-review.googlesource.com/c/sdk/+/253340/2/samples-dev/swarm/App.dart

In the IDE, I see this is recognized ("Prefer using /// for doc comments."), but the only provided quick fixes are to ignore it for either the line or the file. Usually, I see an option to automatically convert to ///.

vsmenon avatar Aug 01 '22 19:08 vsmenon

FYI - @bwilkerson

vsmenon avatar Aug 01 '22 19:08 vsmenon

This is a build of Dart from today:

> dart --version
Dart SDK version: 2.19.0-edge.a9092c76acd7bb9d23e09c2ea411a1acdf28d65c (be) (Mon Aug 1 15:57:53 2022 +0000) on "linux_x64"

vsmenon avatar Aug 01 '22 20:08 vsmenon

The fix appears to not work when one of the lines following the /** is not indented as expected. I also don't see a fix offered for either of the following inputs:

/**
  * c
 */
void f() {}

or

/**
 * c
  */
void f() {}

bwilkerson avatar Aug 01 '22 20:08 bwilkerson

https://dart-review.googlesource.com/c/sdk/+/257521

asashour avatar Sep 03 '22 19:09 asashour