Skip to content

Add support for starred style comments - #347

Merged
NathanReb merged 2 commits into
OCamlPro:masterfrom
NathanReb:fix-312
Jul 27, 2026
Merged

Add support for starred style comments#347
NathanReb merged 2 commits into
OCamlPro:masterfrom
NathanReb:fix-312

Conversation

@NathanReb

Copy link
Copy Markdown
Contributor

Fixes #312

This adds support for indenting comments in the following style:

(* some
 * star aligned
 * comment
 *)

This is enabled when all lines of the comment start with a * and strict_comments=true. It will then align all stars including the one from the comment closing *) when it lives on its own line. The comment close used to always be indented at the same level as the comment open, as reported in #312.
The comment close will also be correctly aligned when strict_comments=false if all comment lines start with a * and are already correctly aligned. Note that without strict_comments comment lines are never indented and simply left untouched which is why we implemented it this way.

As described in OCamlPro#312.

Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
Fixes OCamlPro#312

Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
@NathanReb
NathanReb merged commit 0aa5897 into OCamlPro:master Jul 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to align a comment's opening and closing stars

1 participant