rescript-lang / rescript-lang/rescript-vscode
rescript-editor-analysis.exe format breaks code
Nobody has claimed this yet.
- Dominant language
- ReScript
- Stars
- 354
- Forks
- 63
- Avg merge
- 11h 29m
- Merged PRs (30d)
- 1
Description
When I compile this code with rescript v11.0.1, it works fine. npx rescript format -all does not change it:
type checker = int => bool
let makeChecker: int => checker = modulo => number => mod(number, modulo) == 0
let isEven = makeChecker(2)
Console.log(isEven(7)) // false
When I use the Format document action in VSCode with the v1.38.0 version of the extension, it is changed to this:
type checker = int => bool
let makeChecker: int => checker = (modulo, number) => mod(number, modulo) == 0
let isEven = makeChecker(2)
Console.log(isEven(7)) // false
This does not compile:
We've found a bug for you!
/path/to/Foo.res:3:35-78
1 │ type checker = int => bool
2 │
3 │ let makeChecker: int => checker = (modulo, number) => mod(number, modulo
│ ) == 0
4 │
5 │ let isEven = makeChecker(2)
This function expected 1 argument, but got 2
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
Reproduce the issue with the provided ReScript snippet using npx rescript format -all, then compare it with VSCode's Format document action in extension v1.38.0. Trace the formatter entry point used by the extension and verify that formatting preserves the original curried function and that the formatted output compiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100