Skip to content

Idempotency problem related to comments in with #1686

Closed
@Smaug123

Description

Issue created from fantomas-online

Formatted code

namespace Foo

module Foo =
    let a =
        try
            failwith ""
        with
        // hi!
        :? Exception as e -> failwith ""

Reformatted code

namespace Foo

module Foo =
    let a =
        try
            failwith ""
        with
            // hi!
            :? Exception as e -> failwith ""

Problem description

Fantomas was not able to produce the same code after reformatting the result.

This looks like being #1647 again, maybe?
I still think the right answer here is to retain the | character, though.

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 4.4.0

    { config with
                SpaceBeforeColon = true
                SpaceBeforeSemicolon = true
                IndentOnTryWith = true }

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

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