Skip to content

Comment inside LongIdentWithDots not preserved #2027

Closed
@dbrattli

Description

Issue created from fantomas-online

Code

let path =
    match normalizedPath with
    | path ->
        path  // translate path to Python relative syntax
            .Replace("../../../", "....")
            

Result

let path =
    match normalizedPath with
    | path -> path.Replace("../../../", "....")

Problem description

Fantomas removes comment in method dot chain. It looks tricky since the white-space where the
comment was has been removed. Perhaps the comment should be moved after the .Replace instead? Related to fable-compiler/Fable#2738

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 master branch at 1/1/1990

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

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions