reasonml / reasonml/reason

Incorrect parsing of ocamldoc, module doc gets attached to first declaration

Open
#2,419 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
OCaml
Stars
10.3k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

This try reason link illustrates the issue.

I tried to document my module in .rei file and was unable to make odoc generate html which included module level documentation. I've refmt-printed my .rei to .mli, and found that documentation got attached to first declaration in my module. I've manually added doc comments to .mli, generated documentation and it included module level doc as expected.

dune version: 1.10.0
esy version: 0.5.6
refmt version: Reason 3.3.7 @ 43efc14

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Reason Try example and compare the refmt output from the .rei file with the corresponding .mli documentation comments. Trace how module-level comments are parsed and how odoc consumes them; done means generated HTML includes the module documentation instead of attaching it to the first declaration.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.