Skip to content

Bug: expressions with multi-line comments sometimes left as "one line" #1100

@ceastlund

Description

@ceastlund

Describe the bug
If I write code with a multi-line comment like this, I'd expect ocamlformat to leave it split across lines.

let _ =
  [ "x"
  ; "y"
  (* first line
     second line *)
  ; "z"
  ]
;;

Instead, ocamlformat produces this formatting:

let _ = [ "x"; "y" (* first line
     second line *); "z" ]

How to Reproduce
Run with ocamlformat built from 953c48a and --profile=janestreet.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions