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

Indentation warnings for multiline match expression #1774

Closed
1 of 3 tasks
nojaf opened this issue Jun 12, 2021 · 2 comments · Fixed by #1813
Closed
1 of 3 tasks

Indentation warnings for multiline match expression #1774

nojaf opened this issue Jun 12, 2021 · 2 comments · Fixed by #1813

Comments

@nojaf
Copy link
Contributor

nojaf commented Jun 12, 2021

Issue created from fantomas-online

Code

match structuralTypes |> List.tryFind (fst >> checkIfFieldTypeSupportsComparison tycon >> not) with
| _ -> ()

Result

match structuralTypes
      |> List.tryFind (
          fst
          >> checkIfFieldTypeSupportsComparison tycon
          >> not
      ) with
| _ -> ()

Problem description

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

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 06/09/2021 15:42:35 - a79ebea

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?

@nojaf
Copy link
Contributor Author

nojaf commented Jun 12, 2021

match
    structuralTypes
        |> List.tryFind 
            (
                fst
                >> checkIfFieldTypeSupportsComparison tycon
                >> not
            )
    with
| _ -> 
    ()

appears to be valid.

nojaf added a commit to nojaf/fantomas that referenced this issue Jul 5, 2021
@nojaf
Copy link
Contributor Author

nojaf commented Jul 5, 2021

Also check this one with indent_size = 2.

nojaf added a commit to nojaf/fantomas that referenced this issue Jul 5, 2021
nojaf added a commit that referenced this issue Jul 5, 2021
…ssions. (#1813)

* Apply same alternative formatting for match expression as in if expressions. Fixes #1774.

* Reuse alternative expression formatting with KeepIndentInBranch. Fixes #1812.
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