Closed 20manas closed 10 months ago
You can set files.insertFinalNewline
in VS Code settings to get this behaviour.
You can set
files.insertFinalNewline
in VS Code settings to get this behaviour.
Alright, this is working with the formatter. Thanks!
Is your feature request related to a problem? Please describe. In the POSIX standard, a line is defined as:
A sequence of zero or more non- <newline> characters plus a terminating <newline> character
. The formatter should follow this standard and add a newline at the end of a file.For example, in git diff, when a newline is not present at the end of a file, it shows up like this:
which is quite unnecessary.
With a newline at the end of a file, git diff shows this:![image](https://github.com/mtxr/vscode-sqltools/assets/14952218/e750c9bc-2695-4546-bd8a-b4b1dc9ccd18)
Describe the solution you'd like Add a newline at the end of a file, following the POSIX standard (unless
linesBetweenQueries
ispreserve
?).Describe alternatives you've considered None
Additional context https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline