Skip to content

Bug: comments in function signatures shouldn't be inside parens #966

@Wilfred

Description

@Wilfred
val select :
  (* The fsevents context *)
  env ->
  (* Additional file descriptor to select for reading *)
  ?read_fdl:(fd_select list) ->
  (* Additional file descriptor to select for writing *)
  ?write_fdl:(fd_select list) ->
  (* Timeout...like Unix.select *)
  timeout:float ->
  (* The callback for file system events *)
  (event list -> unit) ->
  unit

Formatting produces:

$ ocamlformat --enable-outside-detected-project --break-separators=after-and-docked /tmp/foo.ml
val select :
  (* The fsevents context *)
  env ->
  ?read_fdl:
    (* Additional file descriptor to select for reading *)
    fd_select list ->
  ?write_fdl:
    (* Additional file descriptor to select for writing *)
    fd_select list ->
  timeout:(* Timeout...like Unix.select *)
          float ->
  ((* The callback for file system events *)
   event list -> unit) ->
  unit

The timeout comment coming after the timeout: is slightly surprising, but putting the callback comment inside the parens is more surprising. Is this intended/configurable?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions