Skip to content

Bug: --doc-comments doesn't apply to all type definitions #981

@Wilfred

Description

@Wilfred

Given the code:

(** one *)
type foo = Bar | Baz

(** two *)
type foo2 = {push: bool; state: bool}

ocamlformat produces:

(** one *)
type foo = Bar | Baz

type foo2 = {push: bool; state: bool}
(** two *)

I'd expected:

type foo = Bar | Baz
(** one *)

type foo2 = {push: bool; state: bool}
(** two *)

This issue seems to occur for both --doc-comments=before (the default, shown here) and --doc-comments=after (where the foo type doesn't end up with its doc comment before).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions