Skip to content

Comment on last match case has wrong indentation #2653

Description

@stefan-schweiger

Issue created from fantomas-online

Code

let test x =
    match x with
    | Value1 -> 1
    // | Value2 -> 2
    | Value3 -> 3

let test2 x =
    match x with
    | Value1 -> 1
    | Value2 -> 2
    // | Value3 -> 3

Result

let test x =
    match x with
    | Value1 -> 1
    // | Value2 -> 2
    | Value3 -> 3

let test2 x =
    match x with
    | Value1 -> 1
    | Value2 -> 2
// | Value3 -> 3

Problem description

If you comment a match case the alignment fits with the rest of the cases, but if you comment the last match case the alignment will be at the start of the line. (Happens with both main and dallas)

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 2022-12-03T22:59:05Z - 47c6ac6

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions