sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[Request] Add quick fix for "expected to find )"

Open bernaferrari opened this issue 4 years ago • 1 comments

When coming from JavaScript/TypeScript, where prettier auto-adds () when formatting, I always fight with Dart analyzer because it complains about my code but it never provides a fix (clicking and calling analyzer is faster than putting two '()' in opposite sides). While this is a trivial case, I've gotten confused in the past with longer chains or with copy and pasting JS code into Dart.

image

Expected:

List<String> lists = [];
lists.map(d => d.); // before
lists.map((d) => d.); // after

For missing ; there is already a quick fix. Only missing () there isn't.

bernaferrari avatar Aug 16 '21 02:08 bernaferrari

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

asashour avatar Aug 25 '21 09:08 asashour

Also related to https://github.com/Dart-Code/Dart-Code/issues/3344 and https://github.com/Dart-Code/Dart-Code/issues/1832.

FMorschel avatar Aug 30 '24 22:08 FMorschel