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

Place parameters on a new line for very long member definitions #719

Closed
nojaf opened this issue Mar 6, 2020 · 1 comment · Fixed by #818
Closed

Place parameters on a new line for very long member definitions #719

nojaf opened this issue Mar 6, 2020 · 1 comment · Fixed by #818

Comments

@nojaf
Copy link
Contributor

nojaf commented Mar 6, 2020

Issue created from fantomas-ui

To align more with the fix of #495, I propose to put the parameters on the next line.

Code

type C () =
    member __.LongMethodWithLotsOfParameters(aVeryLongType: AVeryLongTypeThatYouNeedToUse, aSecondVeryLongType: AVeryLongTypeThatYouNeedToUse, aThirdVeryLongType: AVeryLongTypeThatYouNeedToUse) =  aVeryLongType aSecondVeryLongType aThirdVeryLongType

Result

type C() =
    member __.LongMethodWithLotsOfParameters(aVeryLongType: AVeryLongTypeThatYouNeedToUse,
                                             aSecondVeryLongType: AVeryLongTypeThatYouNeedToUse,
                                             aThirdVeryLongType: AVeryLongTypeThatYouNeedToUse) =
        aVeryLongType aSecondVeryLongType aThirdVeryLongType

Desired result

type C () =
    member __.LongMethodWithLotsOfParameters(
        aVeryLongType: AVeryLongTypeThatYouNeedToUse
        aSecondVeryLongType: AVeryLongTypeThatYouNeedToUse
        aThirdVeryLongType: AVeryLongTypeThatYouNeedToUse)
        =
        aVeryLongType aSecondVeryLongType aThirdVeryLongType

Options

Fantomas Next - 3.3.0-3/6/2020

Name Value
IndentOnTryWith false
IndentSpaceNum 4
KeepNewlineAfter false
MaxIfThenElseShortWidth 40
PageWidth 120
ReorderOpenDeclaration false
SemicolonAtEndOfLine false
SpaceAfterComma true
SpaceAfterSemicolon true
SpaceAroundDelimiter true
SpaceBeforeArgument true
SpaceBeforeColon false
SpaceBeforeSemicolon false
StrictMode false
@nojaf
Copy link
Contributor Author

nojaf commented May 8, 2020

Both the F# style guide and the G-Research style guide have this slightly different than how Fantomas does it today.

I would favour the G-Research guide here as the only difference is having the = on an extra line and the would be more consistent with how long let bindings are formatted.

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

Successfully merging a pull request may close this issue.

1 participant