rescript-compiler
rescript-compiler copied to clipboard
Formatter is inserting blank lines in multiline strings on each format
Thank you for filing! Check list:
- [x] Concise, focused, friendly issue title & description.
- [x] Is it a bug? Usage questions should often be asked in the forum instead.
- [x] A minimal, reproducible example.
- [x] OS and browser versions, if relevant.
- [ ] Is it already fixed in master? Instructions
Description
Having a multiline strin causes the formatter to insert blank lines above an below each line on each an every file format.
Example
Given the following example:
let s = `
1
2
3
`
On the first format call, this becomes:
let s = `
1
2
3
`
On the second:
let s = `
1
2
3
...etc
Version
- OS: Windows 11
- Rescript: 11.0.0-rc.7
Additional Context
As I was writing this issue, I noticed this does not happen with npx rescript format, only when issuing a format call from the IDE, VS Code in my case with the official rescript plugin.
This has to do with the editor line ending settings. Try changing that.
@zth Switching from CRLF to LF did seem to fix it, although this probably should still be marked as a bug?