Bob Nystrom

Results 973 comments of Bob Nystrom

Closing this as a duplicate of #34.

Yeah, those are both pretty bad. These are more cases where the formatting rules for argument lists with trailing commas interacts poorly with other formatting rules.

Wow, yeah. These examples really hit the limitations of the old formatter. I ran them through the [forthcoming](https://github.com/dart-lang/dart_style/issues/1403) [tall style](https://github.com/dart-lang/dart_style/issues/1253) and got: ```dart void assertThatImageLoadingSucceeds(NetworkImageWithRetry subject) { subject .load( subject,...

This is (more or less) intentional. It naturally falls out of how `=>` works, but I could have made it handle this case specifically to match variables. I didn't because...

Interesting. So, in general, the behavior is deliberate. The formatter considers it unidiomatic to have a line comment on the same line as the beginning of a block and puts...

> In some cases it could make comments harder to read. Fair, but I think those cases are pretty rare in practice and easily explained with a second human-oriented comment.

Good point. It's probably worth special casing `// ignore:` comments.

In the [forthcoming](https://github.com/dart-lang/dart_style/issues/1403) [tall style](https://github.com/dart-lang/dart_style/issues/1253), this code gets formatted as: ```dart method() => Intl.message( "This comes from a method", name: 'method', desc: 'This is a method with a ' 'long...

I spent some time looking into this, but wasn't able to come up with a fix that didn't push a lot of other formatting around in generally worse ways. The...

The [forthcoming](https://github.com/dart-lang/dart_style/issues/1403) [tall style](https://github.com/dart-lang/dart_style/issues/1253) moves `)` to the next line when an argument list which happens to resolve the weird formatting here too. With the new style, you get: ```dart...