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

Revisit place parameters on a new line for long definitions #1307

Closed
3 tasks
nojaf opened this issue Dec 19, 2020 · 2 comments · Fixed by #1308
Closed
3 tasks

Revisit place parameters on a new line for long definitions #1307

nojaf opened this issue Dec 19, 2020 · 2 comments · Fixed by #1308

Comments

@nojaf
Copy link
Contributor

nojaf commented Dec 19, 2020

Issue created from fantomas-online

Code

module M =
    let LongFunctionWithLotsOfParameters
        (aVeryLongParam: AVeryLongTypeThatYouNeedToUse)
        (aSecondVeryLongParam: AVeryLongTypeThatYouNeedToUse)
        (aThirdVeryLongParam: AVeryLongTypeThatYouNeedToUse)
        =
        // ... the body of the method follows
        ()

Result

module M =
    let LongFunctionWithLotsOfParameters (aVeryLongParam: AVeryLongTypeThatYouNeedToUse)
                                         (aSecondVeryLongParam: AVeryLongTypeThatYouNeedToUse)
                                         (aThirdVeryLongParam: AVeryLongTypeThatYouNeedToUse)
                                         =
        // ... the body of the method follows
        ()

Problem description

The Microsoft FSharp style guide had a recent change when it comes to long function definitions.
The original snippet is now what it should be.

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 12/18/2020 15:13:04 - 5ecb8db

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?

@knocte
Copy link
Contributor

knocte commented Dec 20, 2020

Should this PR include two more testcases? One where only 1 param is used and another one where a return type is used.

@nojaf
Copy link
Contributor Author

nojaf commented Dec 20, 2020

I'm waiting for dotnet/docs#22098

nojaf added a commit that referenced this issue Dec 22, 2020
* Revisit long function definitions. Fixes #1307.

* Long function definitions with single tuple and no return type.

* Take AlignFunctionSignatureToIndentation into account.

* Long function definitions with return types.

* Update documentation.

* Bump to 4.4.0-alpha-004.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants