sdk
sdk copied to clipboard
[Request] Add quick fix for "expected to find )"
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.

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.
https://dart-review.googlesource.com/c/sdk/+/211243
Also related to https://github.com/Dart-Code/Dart-Code/issues/3344 and https://github.com/Dart-Code/Dart-Code/issues/1832.