rescript-lang / rescript-lang/rescript-vscode
Formatter: Line break with long single pipe
Nobody has claimed this yet.
- Dominant language
- ReScript
- Stars
- 354
- Forks
- 63
- Avg merge
- 11h 29m
- Merged PRs (30d)
- 1
Description
When working with a long module name (typically when using Something__Namespaced), if you use a single pipe it will break line at the argument:
let long =
SomeLongModuleName.make("Lorem Ipsum es simplemente")->SomeLongModuleName.map(
updateFooToBar,
)
This is more difficult to read than if it broke line on the pipe:
let long =
SomeLongModuleName.make("Lorem Ipsum es simplemente")
->SomeLongModuleName.map(updateFooToBar)
I would love it if at the very least I can make the decision myself by introducing a newline, similar with how 2+ pipes will auto break or not
Contributor guide
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 two formatting examples in the issue as the starting cases, and locate the formatter logic that handles a single pipe in a long chained expression. Check how explicit newlines and multiple pipes are currently treated; done means a single pipe can break at the pipe as shown, including when the user introduces a newline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100