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

MultilineBlockBracketsOnSameColumn should be honored inside match block #1238

Closed
2 tasks
knocte opened this issue Nov 10, 2020 · 0 comments · Fixed by #1373
Closed
2 tasks

MultilineBlockBracketsOnSameColumn should be honored inside match block #1238

knocte opened this issue Nov 10, 2020 · 0 comments · Fixed by #1373

Comments

@knocte
Copy link
Contributor

knocte commented Nov 10, 2020

Issue created from fantomas-online

Code

module Foo =
    let Bar () =
        if x then
            match foo with
            | { Bar = true
                Baz = _ } -> failwith "xxx"
            | _ -> None

Result

module Foo =
    let Bar () =
        if x then
            match foo with
            | { Bar = true
                Baz = _ } ->
                failwith "xxx"
            | _ -> None

Expected Result

module Foo =
    let Bar () =
        if x then
            match foo with
            | {
                  Bar = true
                  Baz = _
              }
                -> failwith "xxx"
            | _ -> None

Otherwise, the failwith invocation appearing at the same offset as Bar looks a bit weird

Extra information

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

Options

Fantomas Master at 11/07/2020 09:02:01 - de55bd9

    { config with
                MaxLineLength = 30
                MultilineBlockBracketsOnSameColumn = true }
HumbertoCortes pushed a commit to HumbertoCortes/fantomas that referenced this issue Jan 19, 2021
HumbertoCortes pushed a commit to HumbertoCortes/fantomas that referenced this issue Jan 19, 2021
HumbertoCortes pushed a commit to HumbertoCortes/fantomas that referenced this issue Jan 19, 2021
HumbertoCortes pushed a commit to HumbertoCortes/fantomas that referenced this issue Jan 20, 2021
HumbertoCortes pushed a commit to HumbertoCortes/fantomas that referenced this issue Jan 20, 2021
HumbertoCortes pushed a commit to HumbertoCortes/fantomas that referenced this issue Jan 21, 2021
HumbertoCortes pushed a commit to HumbertoCortes/fantomas that referenced this issue Jan 21, 2021
@nojaf nojaf linked a pull request Jan 22, 2021 that will close this issue
nojaf added a commit that referenced this issue Jan 22, 2021
* #1238 Added function multilineRecordExprAlignBrackets

* #1238 fix the test

* #1238 fantomas format

* #1238 Unit Tests to test MultilineBlockBracketsOnSameColumn = true are changed

* #1238 Fantomas format

* #1238 test added: MultilineBlockBracketsOnSameColumn should be honored inside let binding, 1238

* #1238 fantomas format

* Minor nitpicks.

Co-authored-by: humberto-javier.cortes-benavides <[email protected]>
Co-authored-by: Florian Verdonck <[email protected]>
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