Closed SCullman closed 5 years ago
@jindraivanek this is another good example where preserveLineBreaks put in a newline and just guesses what the indentation should be. It does take the IndentSpaceNum
setting into account.
@jindraivanek do you agree with the changes in https://github.com/fsprojects/fantomas/pull/434/commits/676965e6ec196983ab5e5253c1fb94940e31af22? I think we will make a lot of people happy with preserving the newline after an equal sign.
I don't agree with this, I think Fantomas should format into one style regardless newlines in original source code (with exception of keeping blank lines separators).
My general opinion on stuff like this is that Fantomas should do one-liner if possible, otherwise newline+indent if following block will be multiline.
Ok, I've reverted the changes for now. https://github.com/fsprojects/fantomas/pull/434/commits/32653bc923ef30fd6dacc370ffcef15e0a1ce7a9 People can let us know what they think about this below.
And if you really want to force the content after the =
you can always add a comment after =
.
F.ex.
let foo = //
a + b
Maybe that can be a good compromise.
Discussing further in #449.
Description
IndentSpaceNum is ignored if PreserveEndOfLine is enable
Repro code
http://ratatosk.dynu.net/fantomas/#?code=DYUwLgBAhgJj0QEYQLwQLACgEGolA&config=N4IgkgdgJgphAuBlADgQwMYwHIFcC2IAXACwA0IACqgOYwDqAllPABZEAcADORQE4wBnGLwBuMAKLQA8gDMAMgwgwi8XjhjlEMPA3QB7ADZ6IAQXiSoshUqIzUBoZrSYAQjBl7+J3tXxx4KmoaICgYMG4e-ADChsaB6k5hJjLwwjF4eKjxwaGYyam8Wjr6RhDZ5JCwCFIQACq8AJ6MrLb2jiAASjCesLxSyHAAIjDoBqi8qPAMcYR2DjnOMN56ONDDBgw6BeUhqrrwALJ6sK3zAL5AA
Input:
formats to
expected