reason icon indicating copy to clipboard operation
reason copied to clipboard

[refmt] Refmt favors multiple lines for short tuples and lists

Open mlms13 opened this issue 6 years ago • 0 comments

In general, I find this:

[123, 456789, 0]

easier to read than this:

[
  123,
  456789,
  0
]

In the case where this list is defined after a very long pattern match, for example, refmt prefers the multi-line approach, instead of having the full list definition on a single new line:

/* ideal, in my opinion */
| Some(VeryVeryVery(Loooooong(PatternMatch(_)))) =>
  [123, 456789, 0]

/* what refmt currently does */
| Some(VeryVeryVery(Loooooong(PatternMatch(_)))) => [
    123,
    456789,
    0
  ]

The same also applies to tuples (and probably arrays).

Here's a more complete playground example.

mlms13 avatar Feb 20 '19 19:02 mlms13