reasonml / reasonml/reason

Properly re-indent comments.

Open
#44 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

KIND: FEATURE REQUEST Printer
Dominant language
OCaml
Stars
10.3k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

One issue that's going to come up when converting code from OCaml, and also when indenting your own code (but less likely), is that comments now begin in a new column, and therefore must be shifted over.

Right now, we just copy the entire comment including newlines, but shift the starting column over. See the screenshot for how that will lead to improperly indented comments.

screen shot 2016-01-13 at 11 12 21 pm

We should indent the entire comment over by the same amount that we are shifting the first line.

Here's an example of the formatter running on an existing comment.

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

No source files or tests are named. Start by locating the formatter logic that copies and shifts multiline comments, then compare its output with the screenshot and example in the issue. Done means every line of a comment moves by the same indentation amount as its first line.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.