fantomas icon indicating copy to clipboard operation
fantomas copied to clipboard

Code comment after expression is assigned to parenthesis.

Open nojaf opened this issue 4 years ago • 0 comments

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 - fd67416baa1e7ebf63d20e064041d1e0bce61881

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?

nojaf avatar Aug 11 '21 15:08 nojaf