Skip to content

Empty let moves comments #917

@brandonchinn178

Description

@brandonchinn178

Describe the bug
let is allowed to have no bindings, but this causes any comments later in the file to be moved into the let

To Reproduce

foo =
  let
   in 10

-- a comment
bar = 20

gets reformatted to

foo =
  let -- a comment

   in 10

bar = 20

Expected behavior
Should not change

Environment

  • OS name + version:
  • Version of the code: ormolu-live.tweag.io

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcommentsIssues related to comment placement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions