Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Rescript formatter incorrectly moves comments #661

Closed
@siddharth-krishna

Description

@siddharth-krishna

The rescript formatter incorrectly moves comments out of the block/function that they are in. For example,

doSomething()
->Js.Promise.then_(
  result =>
    // Comment 1
    switch result {
    | Some(y) =>
      // Comment 2
      something()
      // Comment 3
      somethingElse()
    | None => ()
    },
  _,
)

becomes

doSomething()->Js.Promise.then_(
  result =>
    switch result {
    | Some(y) =>
      something()

      somethingElse()
    | None => ()
    },
  // Comment 1

  // Comment 2

  // Comment 3

  _,
)

Rescript and the formatter are awesome! But this issue is one of the last few blockers to adding the formatter to our pre-commit / PR process..

Rescript version: 10.0.1
VS Code extension: v1.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions