Skip to content

Regression: An empty line or comment at the end of a list breaks Stroustrup formatting #3079

@Linschlager

Description

@Linschlager

Issue created from fantomas-online

Code

let array = [|
    someItem

|]

let array2 = [|
    someItem
    // comment
|]

Result

let array =
    [|
        someItem

    |]

let array2 =
    [|
        someItem
    // comment
    |]

Problem description

Placing an empty line or comment on the last line of an arrow, list or similar breaks Stroustrup formatting

Extra information

Might be related to one of the following:


  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.
  • I would like a release if this problem is solved.

Options

Fantomas main branch at 15/4/2024

    { config with
                MultilineBracketStyle = stroustrup }

Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

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