Skip to content

New Line after Computation Expression Name Breaks Code #2832

Open
@panmona

Description

@panmona

Issue created from fantomas-online

Code

let testXYZ value =
    test "A very long and descriptive text about what this test is supposed to do and test for the test case" {
        let a, b = someModule.someFun value
        Expect.isLessThan a b "Expected a to be lower than b"
    }

Result

let testXYZ value = test
    "A very long and descriptive text about what this test is supposed to do and test for the test case" {
    let a, b = someModule.someFun value
    Expect.isLessThan a b "Expected a to be lower than b"
}

Problem description

There's a new line inserted after the "test" computation expression keyword, which breaks the code:
image

I would expect the code to be:

// ...
test "A very long and descriptive text about what this test is supposed to do and test for the test case" {
// ...

Extra information

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

Options

Fantomas main branch at 2023-04-05T14:35:42Z - 1492e67

    { config with
                MultilineBracketStyle = stroustrup
                NewlineBeforeMultilineComputationExpression = false }

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions