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

Multiline SynPat.Record in pattern match is formatted as a mixture of single/multiline styles #1173

Closed
3 tasks
Fizzixnerd opened this issue Sep 27, 2020 · 1 comment · Fixed by #1174
Closed
3 tasks

Comments

@Fizzixnerd
Copy link
Contributor

Issue created from fantomas-online

Code

match foo with
| { Bar = bar
    Level = 12
    Vibes = plenty
    Lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " } ->
    "7"
| _ -> "8"

Result

match foo with
| { Bar = bar; Level = 12; Vibes = plenty;
    Lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " } ->
    "7"
| _ -> "8"

Problem description

I believe it should be formatted as the input is, unless I've missed something important. Also affects MultilineBlockBracketsOnSameColumn = true.

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 09/26/2020 18:28:15 - 0771e9a

Default Fantomas configuration

@nojaf
Copy link
Contributor

nojaf commented Sep 27, 2020

The fact that MultilineBlockBracketsOnSameColumn = true has no effect here is deliberately.
It is rather complex to solve and it doesn't occur in the wild at GR, so it was not tackled on purpose.

For the default scenario, PatRecord could use a change.

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.

2 participants