Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code comment after expression is assigned to parenthesis. #1864

Open
3 tasks
nojaf opened this issue Aug 11, 2021 · 0 comments
Open
3 tasks

Code comment after expression is assigned to parenthesis. #1864

nojaf opened this issue Aug 11, 2021 · 0 comments

Comments

@nojaf
Copy link
Contributor

nojaf commented Aug 11, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant