fsprojects / fantomas

FSharp source code formatter
https://fsprojects.github.io/fantomas
Other
758 stars 189 forks source link

POC double indentation. #3039

Open nojaf opened 5 months ago

nojaf commented 5 months ago

Quick implementation of having double indentation for long function signature parameters.

//cc @auduchinok @dawedawe @josh-degraw @Smaug123

Note that the equals sign rule didn't change. The guide is pretty clear on that. It goes on its own line. Unless the last parameter is a long tuple.

For the sake of source control, I wouldn't change that:

image

image

Smaug123 commented 5 months ago

@auduchinok I'd be interested to hear more about what this change lets you do.

nojaf commented 3 months ago

I talked a bit more with @auduchinok on this.

It could be interesting to follow the approach of putting parameters on the current line until the max line length is crossed:

Screenshot 2024-03-13 at 15 00 15 Screenshot 2024-03-13 at 14 54 45 Screenshot 2024-03-13 at 14 56 06 Screenshot 2024-03-13 at 15 00 08 Screenshot 2024-03-13 at 14 54 41 Screenshot 2024-03-13 at 14 18 05 Screenshot 2024-03-13 at 14 18 01

It keeps things compact and having the double indent helps to differentiate the parameters with the body.