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
As discussed in fsprojects/fantomas#2706 and fsprojects/fantomas#2852, with the recent changes regarding multiline bracket formatting, multiline generic type parameters don't necessarily always follow the same guidelines, so we should formalize how they can/should be formatted.
For example, if using Stroustrup bracket style, you might expect
This code is invalid. The compiler sees these as two separate statements. So short of updating the compiler, code in this style will need to have at least one additional space on the newline before the closing angle bracket.
Bikeshedding question: should this be the minimal change necessary (1 space)? Or should it be a multiplier of your indent_size (if you use 2 spaces, use 2 spaces)?
Also, it probably should be noted that truly "Aligned" angle bracket style doesn't work:
Bikeshedding question: should this be the minimal change necessary (1 space)? Or should it be a multiplier of your indent_size (if you use 2 spaces, use 2 spaces)?
Using the indent_size will make it seem more deliberate I think. A single space will indeed strike more as a bug.
This code is invalid. The compiler sees these as two separate statements. So short of updating the compiler, code in this style will need to have at least one additional space on the newline before the closing angle bracket.
I agree that ideally this should be valid for the compiler.
As discussed in fsprojects/fantomas#2706 and fsprojects/fantomas#2852, with the recent changes regarding multiline bracket formatting, multiline generic type parameters don't necessarily always follow the same guidelines, so we should formalize how they can/should be formatted.
For example, if using
Stroustrup
bracket style, you might expectto be formatted like this:
However, the placement of the angle brackets can be problematic.
For example, if you have an application expression:
And try to directly apply
Stroustrup
style to it:This code is invalid. The compiler sees these as two separate statements. So short of updating the compiler, code in this style will need to have at least one additional space on the newline before the closing angle bracket.
Bikeshedding question: should this be the minimal change necessary (1 space)? Or should it be a multiplier of your
indent_size
(if you use 2 spaces, use 2 spaces)?Also, it probably should be noted that truly "Aligned" angle bracket style doesn't work:
Some users may expect that to work but it's invalid code. We should maybe update the style to mention this (if it's not there already).
The text was updated successfully, but these errors were encountered: