rescript-lang / rescript-lang/rescript-vscode
Formatting Issue with Multi-line Comments and JSDocs in .res files
Nobody has claimed this yet.
- Dominant language
- ReScript
- Stars
- 354
- Forks
- 63
- Avg merge
- 11h 29m
- Merged PRs (30d)
- 1
Description
Description
I encounter a formatting issue when working with multi-line comments or JSDocs in ReScript using the extension. Each time I format the code, extra new lines are added, leading to inconsistent formatting. This behavior is affecting the readability and aesthetics of my code. Not only that but not being able to have JSDocs formatted correctly makes it harder to document and maintain my code base when working with ReScript.
Steps to Reproduce
- Write ReScript code containing multi-line comments or JSDocs.
- Format the code using the extension.
- Observe the addition of extra spaces in multi-line comments or strings.
Expected Behavior
The extension should format multi-line comments and JSDocs consistently without introducing extra spaces or new lines.
Actual Behavior
Extra lines are added each time the code is formatted, impacting the code's appearance.
Environment
- Extension Version: 1.36.0
- Formatter: ReScript (official) (Also happens when no code formatter is defined)
- Visual Studio Code Version: 1.85.1
- Operating System: X64 Windows 10.0.19045
Demonstration of Bug
Figure 1. Before Formatting ReScript code
Figure 2. After Formatting ReScript code once
Figure 3. After Formatting ReScript code twice
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 in a .res file containing multi-line comments or JSDocs, then format it repeatedly with the extension. Verify that formatting no longer adds extra spaces or new lines and that the result remains stable across repeated formatting.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100