Bob Nystrom

Results 973 comments of Bob Nystrom

> It already adds spaces for initializer list with several entries Yeah, I agonized over that one. :-/

I don't think there's an ideal way to format constructor initializer lists. They're just pretty syntactically weird. If we don't do extra padding before the `:` then it means a...

It is [a non-goal to let users opt out of formatting](https://github.com/dart-lang/dart_style/wiki/FAQ#why-cant-i-tell-the-formatter-to-ignore-a-region-of-code). I agree the output in this particular case is not great. :( Like @srawlins notes, it has to do...

> What about the idea to give dartfmt a hint like we can do by adding a trailing comma? So that by adding a space dartfmt knows where to break...

Why are the bodies of `test()` indented but `group()` is not? Why is this better than how it currently formats it?

It's pretty common to chain higher-order functions. In your example, would they march farther and farther to the right? ```dart return Observable(_databaseService.getChatEntries( event, )).map((entryList) { entryList.forEach( (entry) => entry.isFromCurrentUser =...

Earlier, I said: > Unfortunately, due to some limitations in the line splitting algorithm, it can't currently gracefully switch between allowing a trailing method call on the same line when...

The [forthcoming](https://github.com/dart-lang/dart_style/issues/1403) [tall style](https://github.com/dart-lang/dart_style/issues/1253) gives you: ```dart Zone.current.scheduleMicrotask( Zone.current.bindCallback(callback, runGuarded: true), ); ``` That's not the same as the original formatting, of course, because of the change to how argument...

I'm worried this may require us to eventually slurp an entire Markdown parser into dartfmt (which would probably be a bad thing), but it would definitely be nice.

Yet another case where trailing commas interact poorly with other formatting rules. :(