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

MultiLineLambdaClosingNewline + ExperimentalStroustrupStyle is not displaying very well for some use cases #2378

Closed
3 tasks
albertwoo opened this issue Jul 20, 2022 · 3 comments · Fixed by #2714

Comments

@albertwoo
Copy link

Issue created from fantomas-online

Code

MudButton'() {
    style { displayInlineBlock }
    Disabled isLoading
    OnClick(fun _ -> task {
        setIsLoading true
        do! hook.DownloadTransactionReports()
        setIsLoading false
    })
    i18n.tran "Common.BtnDownload"
}

Result

MudButton'() {
    style { displayInlineBlock }
    Disabled isLoading
    OnClick(fun _ -> task {
        setIsLoading true
        do! hook.DownloadTransactionReports()
        setIsLoading false
    }
    )
    i18n.tran "Common.BtnDownload"
}

Expected

Can we put

}
)

into one line ?

Problem description

Please describe here the Fantomas problem you encountered.
Check out our Contribution Guidelines.

Extra information

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

Options

Fantomas master branch at 2022-07-19T14:35:52Z - 0fe6785

    { config with
                MultiLineLambdaClosingNewline = true
                BlankLinesAroundNestedMultilineExpressions = false
                ExperimentalStroustrupStyle = 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 20, 2022

Hello, on paper this sounds reasonable.

However, a lot will depend on the implementation. I would accept a PR if it can be solved in an elegant way. If there is too much church to get this right, this would be an acceptable limitation.

Are you interested in submitting a proposal PR?

@albertwoo
Copy link
Author

Sorry, it maybe too complex to me.

@nojaf
Copy link
Contributor

nojaf commented Jul 20, 2022

Please elaborate on what might be too complex for you.
We are working on a new documentation initiative #2315 and hope to encourage people to contribute.
A lack of knowledge of this project nor the F# language should not be a bottleneck.
I'm curious to find out what is too complex about this or why you immediately assume this.

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