fsprojects / fantomas

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

Multiline paren expr in chained application leads to invalidate code #2816

Open nojaf opened 1 year ago

nojaf commented 1 year ago

Issue created from fantomas-online

Code

let usageFile =
    (FsSource
        """
module B

let otherGenericFunction _ _ _ =
    A.someGenericFunction 1
""" )
        .WithFileName("B.fs")

Result

let usageFile =
    (FsSource
        """
module B

let otherGenericFunction _ _ _ =
    A.someGenericFunction 1
""")
        .WithFileName("B.fs")

Problem description

The ( and ) need to be aligned when the application is followed by a .(a) application. In this case, an additional space is required to aligned them. Note that this is not required when .WithFileName("B.fs") is not present.

Extra information

Options

Fantomas main branch at 2023-03-30T06:24:24Z - b5d29bd2d174d50ab540532997d461705ae02f47

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?