ocamlformat icon indicating copy to clipboard operation
ocamlformat copied to clipboard

Style suggestion: style ppx-extended function declarations like regular function declarations

Open lord opened this issue 10 months ago • 2 comments

Current formatting

let _ =
  my_func ~hello ~world
    ~f:
      (fun%my_ppx x ->
        let x = 1 + 2 in
        x)

This formatting is similar for function%my_ppx as well.

Describe the formatting you'd like Ideally indentation would match what the fun declaration would look like without the %my_ppx, which in the default profile looks like this:

let _ =
  my_func ~hello ~world ~f:(fun x ->
      let x = 1 + 2 in
      x)

Additional context I guess the fact that these are formatted differently almost feels like a bug? Not sure why any user would want unique behavior for these kinds of function declarations, but maybe I don't know how ppxes are being used here

lord avatar Feb 14 '25 15:02 lord