You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove TODO about non-inline block comments. (#1400)
The TODO questions whether we should make a distinction between C-style
block comments that have newlines around them in the original source or
not. If we don't, then the formatter would turn code like:
```dart
main() {
/*
entireBody();
commentedOut();
forSomeReason();
*/
}
```
Into:
```dart
main() {/*
entireBody();
commentedOut();
forSomeReason();
*/}
```
I did a little scraping of a corpus, and there are quite a few block
comments like this in the wild, and I think it looks better to keep them
on their own lines if the input code has a newline before or after the
comment.
Also, the implementation complexity of distinguishing inline block
comments and non-inline ones is trivial. Removing support for it would
change like three lines of code.
So I think it's best to just keep supporting the distinction because it
leads to better output, is consistent with the current formatter, and
doesn't add much complexity.
0 commit comments