reason icon indicating copy to clipboard operation
reason copied to clipboard

[refmt] Add or at least preserve end of file newline

Open Kingdutch opened this issue 6 years ago • 3 comments

It's common practice to have files ending in newlines, if only to keep git from telling us "\ No newline at end of file" for every diff. A newline at the end of the file also makes it easier to append things to a file without manually going to the end of the last line and inserting a newline.

I feel like refmt should add the newline to the end of the file when printing it or at least preserve a newline if it's there. Currently it's constantly removing trailing newlines which is quite a nuisance.

Kingdutch avatar Dec 24 '19 20:12 Kingdutch

Friendly ping! It'd be great to not default to trimming the newline, which can cause ugly git diffs.

bsansouci avatar Apr 07 '20 18:04 bsansouci

I think this isn't a refmt problem, but a problem on rls, https://github.com/jaredly/reason-language-server/pull/424

EduardoRFS avatar May 28 '20 21:05 EduardoRFS

Can confirm rls from master branch fix this issue, it can be closed.

Austaras avatar Jun 19 '20 19:06 Austaras