You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apart from a few spaces, this is also how Fantomas formats it. I'm ignoring those spaces in the following.
The expression is complicated enough that I'm having a hard time separating the clauses from the bodies. This is complicated by the fact that some clauses are joined (they use the same ->), and others are not. The code is not easily readable.
I don't have a definite general rule that can be applied, but I certainly find this more readable:
Here, I have placed all bodies on separate lines. This is of course not a rule that can be applied generally (it would look worse than single-line placement for short/simple match expressions).
The following also look better, IMHO. Here, bodies that apply to clauses with more than one line are placed on a separate line. Perhaps that can be a general rule?
To be clear, in this particular case, I still find it less readable than the "always break" alternative. For example, I have to look thorouthly to see that | SynType.StaticConstantExpr (expr, _) -> traverseSynExpr [] expr is a clause and a body, and not just a long clause.
I'm not heavily invested in this, but thought I'd raise the issue when I noticed it.
The text was updated successfully, but these errors were encountered:
Adjustments to the style guide should generally only be made with consideration about their implementability in Fantomas, and if an adjustment is approved you should be prepared to contribute a matching pull request to Fantomas.
If there is no interest to commit, you should not propose any changes.
This is from the F# compiler:
Apart from a few spaces, this is also how Fantomas formats it. I'm ignoring those spaces in the following.
The expression is complicated enough that I'm having a hard time separating the clauses from the bodies. This is complicated by the fact that some clauses are joined (they use the same
->
), and others are not. The code is not easily readable.I don't have a definite general rule that can be applied, but I certainly find this more readable:
Here, I have placed all bodies on separate lines. This is of course not a rule that can be applied generally (it would look worse than single-line placement for short/simple match expressions).
The following also look better, IMHO. Here, bodies that apply to clauses with more than one line are placed on a separate line. Perhaps that can be a general rule?
To be clear, in this particular case, I still find it less readable than the "always break" alternative. For example, I have to look thorouthly to see that
| SynType.StaticConstantExpr (expr, _) -> traverseSynExpr [] expr
is a clause and a body, and not just a long clause.I'm not heavily invested in this, but thought I'd raise the issue when I noticed it.
The text was updated successfully, but these errors were encountered: