jaredly / jaredly/reason-language-server
Syntax highlighting missing for 3rd+ mutually recursive type
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 649
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
The "type" ... "and" syntax works for the first "type" and the first "and", but each subsequent "and" is not highlighted correctly:

```
type firstBlock = {
headline: list(shape),
body: list(middleBlock),
tail: option(lastBlock),
}
and middleBlock = {
headline: list(shape),
sections: list(section),
}
and lastBlock = {headline: list(shape)}
/* A section is used by "middleBlock" to keep track of the number of "mouths" (e.g. for if/else blocks) */
and section = {
body: list(middleBlock),
tail: option(lastBlock),
footline: list(shape),
};
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the recursive type declaration example in the issue as the reproduction case, then locate the syntax-highlighting implementation for Reason type declarations. Check how the first `type` and `and` are recognized and compare that with subsequent `and` tokens. Done means every `and` in the example is highlighted consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- devtools, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100