Skip to content

Code comment after expression is assigned to parenthesis. #1864

Open
@nojaf

Description

@nojaf

Issue created from fantomas-online

Code

Target.create "Install" (fun _ ->
    Yarn.install (fun o -> { o with WorkingDirectory = clientDir })
    // Paket restore will already happen when the build.fsx dependencies are restored
)

Result

Target.create
    "Install"
    (fun _ ->
        Yarn.install (fun o -> { o with WorkingDirectory = clientDir })
        // Paket restore will already happen when the build.fsx dependencies are restored
        )

Problem description

This issue is less visible from the result above but the comment on a single line trivia is assigned to the closing parenthesis token. The better candidate, in this case, would have been the Yarn.install ... function application.

Trivia assignment needs to be smarter in this case.
Related to #932

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 at 08/11/2021 06:58:03 - fd67416

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions