Closed nojaf closed 1 year ago
Looks right 👍
@nojaf When you implement this, could you send a link to all the changes in the Fantomas tests for second review? I want to make sure there aren't any unintended consequences.
Will do! @josh-degraw could I persuade you to pair on these?
Just saw this, yeah I'd be down!
@josh-degraw I already went ahead with this one. I did not change anything regarding anonymous records, we can pair on that together and finish https://github.com/fsprojects/fantomas/pull/2424.
The current guidance doesn't explicitly state the best practice regarding multiline type annotations.
Abstractly put:
Where
t
is multiline or crossed the maximum line length.I propose to simply indent
t
on the following line if these conditions are met.Some examples to illustrate:
I believe in practice, this won't show up that much. Nevertheless, the principle still holds and is consistent with other parts of the guide. It also does not introduce any vanity alignments.
Some further context can be found in https://github.com/fsprojects/fantomas/pull/2424#issuecomment-1230033101
Somewhat related, if
t
is placed on the next line, depending on what it is, it might still need alternate formatting to respect the max_line_length.If
t
is a long tuple type, I would also split it onto multiline lines. Similar to how signature files are described in the guide.Relevant example:
For lambda expression, in the bizarre case that the arguments cannot fit on the same line of the
fun
keyword, I would indent them on the next line.Relevant example:
//cc @dsyme @josh-degraw