Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected loss of newline in closing bracket #1835

Closed
3 tasks
Smaug123 opened this issue Jul 20, 2021 · 1 comment · Fixed by #1910
Closed
3 tasks

Unexpected loss of newline in closing bracket #1835

Smaug123 opened this issue Jul 20, 2021 · 1 comment · Fixed by #1910

Comments

@Smaug123
Copy link
Contributor

Issue created from fantomas-online

Code

module Foo =
    let blah =
        printfn ""
        (fun bar ->
            printfn ""
            bar + "11111111111111111111111111111111"
        )

Result

module Foo =
    let blah =
        printfn ""

        (fun bar ->
            printfn ""
            bar + "11111111111111111111111111111111")

Problem description

I was expecting MultiLineLambdaClosingNewline to result in retaining the newline in this lambda. It seems to be a problem when the lambda is the last expression in a function body.

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 07/18/2021 11:37:23 - 23cefe5

    { config with
                MultiLineLambdaClosingNewline = true }

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

@nojaf
Copy link
Contributor

nojaf commented Jul 24, 2021

Ah, as it is not part of an application this is not captured with the current MultiLineLambdaClosingNewline implementation.
Would you mind adding this to the style guide as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants