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

AST differs on comment in line before $ in a do block #1028

Open
amesgen opened this issue May 20, 2023 · 0 comments
Open

AST differs on comment in line before $ in a do block #1028

amesgen opened this issue May 20, 2023 · 0 comments
Labels
bug Something isn't working comments Issues related to comment placement

Comments

@amesgen
Copy link
Member

amesgen commented May 20, 2023

Describe the bug
Formatting this code with --unsafe

foo = do
  bar
    -- txt
    $ baz

yields

foo = do
  bar
  -- txt
  $
    baz

which has differing AST: The LHS of $ is now the entire do block.

Expected behavior
It should be formatted correctly, e.g. with output

foo = do
  bar $
    -- txt
    baz

The same thing happens for all infixr 0 (isHardSplitterOp) operators.

Environment

  • Version of the code: Ormolu 0.7.0.0 or 49eb083 (current master)

Additional context
This is not reproducible on the current Ormolu Live; but this is completely unrelated, will open a PR (EDIT: #1029) for that soon. Now fixed.

@amesgen amesgen added bug Something isn't working comments Issues related to comment placement labels May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working comments Issues related to comment placement
Projects
None yet
Development

No branches or pull requests

1 participant