fsprojects / fantomas

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

Breaks shorthand lambda atomicity for lowercase method invocations #3023

Closed cmeeren closed 4 months ago

cmeeren commented 9 months ago

Issue created from fantomas-online

Code

x |> Option.map _.serialize()

Result

x |> Option.map _.serialize ()

Problem description

If the new shorthand lambda syntax is used with a lower-case method invocation, a space is added and the code breaks because the lambda expression is no longer atomic.

Workarounds:

This is likely related to how Fantomas handles uppercase vs. lowercase invocations. I hope a special case can be added to never insert a space in shorthand lambda expressions.

Extra information

Options

Fantomas main branch at 1/1/1990

Default Fantomas configuration

Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

dawedawe commented 4 months ago

Fixed in 6.3.5