Bob Nystrom

Results 973 comments of Bob Nystrom

This is working as intended. Can you show me an example where you think it makes the code look worse? It's probably not obvious, but one reason the formatter makes...

Ah, interesting. That's a consequence of the fact that trailing comma argument lists are formatted the same way collection literals. For collection literals, it is deliberate that it moves the...

I spent a lot of time working on how to best handle comments at the beginning of delimited sections in [the new style](https://github.com/dart-lang/dart_style/issues/1253). It's not unreasonable to want to leave...

This is formatted as expected. Expression indentation is generally +4 and in the formatted code you can see the `?` is indented four spaces relative to `var`, which is the...

I tested this example out using the [forthcoming](https://github.com/dart-lang/dart_style/issues/1403) [tall style](https://github.com/dart-lang/dart_style/issues/1253). Here's what it produces: ```dart void main() { var result = condition ? doA( param1, // comment to force split...

> ```dart > return maps > .where((map) => map != null) > .expand((map) => map!.entries) > .fold({}, (merged, entry) { > merged[kp(entry.key)] = vp(entry.value); // return merged; // }); //...

I ran these examples through the [forthcoming](https://github.com/dart-lang/dart_style/issues/1403) [tall style](https://github.com/dart-lang/dart_style/issues/1253) and it produces: ```dart return maps .where((map) => map != null) .expand((map) => map!.entries) .fold({}, (merged, entry) { merged[kp(entry.key)] = vp(entry.value);...

Running this through the [forthcoming](https://github.com/dart-lang/dart_style/issues/1403) [tall style](https://github.com/dart-lang/dart_style/issues/1253), produces: ```dart final documentChanges = (json['documentChanges'] is List && (json['documentChanges'].every( (item) => TextDocumentEdit.canParse(item, nullLspJsonReporter), ))) ? Either2< List, List >.t1( json['documentChanges'] ?.map( (item)...

Oof. There is probably some interesting stuff we could do to better handle cases where the formatter couldn't get the line to fit. Maybe look for long identifiers and strings...

It implemented the old `inline class` syntax, but not the new `extension type` syntax.