Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stable] Roll latest dart_style into the SDK.
The fixes are: 1. Comments in switch expressions would force the next line to split: ``` // Before: return switch (level) { 0 => a, // Comment. 1 when flag => b, }; // After: return switch (level) { 0 => a, // Comment. 1 when flag => b, }; ``` 2. Method calls on split record literals split before the ".": ``` // Before: final a = ( element, element, ) .getter; // After: final a = ( element, element, ).getter; ``` 3. Change how parameter metadata is formatted: ``` // Before: function( @required int n, @deprecated('Some long deprecation string.') String s) { ... } // After: function( @required int n, @deprecated('Some long deprecation string.') String s) { ... } ``` This change also significantly improves performance in rare cases where a function has many parameters. Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/302500 Change-Id: I56cd6ceb81ad9c98ca7f5d34eea05ef5d29228fb Fixes: #52346 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302451 Reviewed-by: Alexander Thomas <[email protected]> Commit-Queue: Bob Nystrom <[email protected]>
- Loading branch information