jaredly / jaredly/reason-language-server

Syntax highlighting missing for 3rd+ mutually recursive type

Open
#121 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

syntax highlighting
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:

![image](https://user-images.githubusercontent.com/129/44687020-442e9380-aa0d-11e8-84ee-ae46d927deb4.png)

```
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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.