Refmt doesn't break the line when an extra long string occurs in switch branch
Open
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
Here's a piece of code to reproduce:
let a = None;
let thing =
switch (a) {
| None => "error"
| Some(fahrenheit) => "Unreasonably long string string string stringgggggggggggggg"
};
Expected:
let a = None;
let thing =
switch (a) {
| None => "error"
| Some(fahrenheit) =>
"Unreasonably long string string string stringgggggggggggggg"
};
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
Start with the reproducible Reason example and the linked Melange playground, then compare the formatter's output with the expected output shown in the issue. Done means the long string in the switch branch begins on its own indented line while the surrounding formatting remains unchanged.
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
- Clearly specified
- Newbie friendliness
- 45/100