Extension|Author (truncated)|Version
---|---|---
markdown-toc|Ala|1.5.6
vscode-eslint|dba|1.2.11
EditorConfig|Edi|0.10.0
beautify|Hoo|1.1.1
sublime-keybindings|ms-|2.9.1
debugger-for-chrome|msj|3.2.1
material-icon-theme|PKi|2.2.0
(1 theme extensions excluded)
Steps to Reproduce:
The newlines has been just added is removed automatically.
Reproduces without extensions: Not test yet.
Maybe it was caused by some plugin, especially EditorConfig.
Hope the priority of settings.json is higher than a plugin, or some configuration to set it.
My settings.json:
...
"files.encoding": "utf8",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
...
I have the same issue on mac. It was working perfectly fine yesterday, but it's broken now.
I've tried removing all extensions and settings... But I could not fix it.
I've realised that using prettify extension, the final newline is added on saving, but a few milliseconds later, it is removed again. Looks to me that there's some format process going on in the background that is messing up the final newline.
Maybe it was caused by some plugin, especially EditorConfig
That's it. Remove EditorConfig - problem solved.
I cannot reproduce.
I wonder if this issue is being caused by an installed extension. Can you try to run VS Code without extensions? From the command line (NOT the integrated terminal in Code), execute: code --disable-extensions and try your steps again to see if it reproduces. If you see it is an issue with the extension, please file it against the extension repository itself.
Hello together,
I could reproduce this issue as well. I also got an update for the EditorConfig Extension as well and after installing it, everything works fine again. After a short research I could find out, this issue came from the EditorConfig Extension version 10.0 and was 'fixed' in 10.1.
https://github.com/editorconfig/editorconfig-vscode/issues/169
Most helpful comment
That's it. Remove EditorConfig - problem solved.