rescript-lang / rescript-lang/rescript
Weird formatting when coercing types with `:>`
Open
Nobody has claimed this yet.
syntax
- Dominant language
- OCaml
- Stars
- 7.5k
- Forks
- 485
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 55
Description
This line is 105 characters long so it should break before the ->LongModuleName.longFunctionName, but it does not.
(LongModuleName.makeNoParams() :> LongModuleName.subTypeOfLongTypeName)->LongModuleName.longFunctionName
This one breaks between the parameters of the make function:
// Before formatting
(LongModuleName.make( ~a=1, ~b="",) :> LongModuleName.subTypeOfLongTypeName)->LongModuleName.longFunctionName
// After formatting
(LongModuleName.make(
~a=1,
~b="",
) :> LongModuleName.subTypeOfLongTypeName)->LongModuleName.longFunctionName
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
Start with the linked Playground reproduction and compare the formatter's output for the two coercion examples. The work is done when the 105-character expression breaks before the arrow to longFunctionName rather than between make's parameters, with the existing formatting behavior preserved elsewhere.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100