Vscode: files.insertFinalNewline operation failure

Created on 6 Sep 2017  路  4Comments  路  Source: microsoft/vscode

  • VSCode Version: Code 1.15.1 (41abd21afdf7424c89319ee7cb0445cc6f376959, 2017-08-16T18:07:25.676Z)
  • OS Version: Windows_NT x64 6.1.7601
  • Extensions:

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:

  1. Open any file
  2. Add some newline to the bottom
  3. Save

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,
...
needs more info upstream

Most helpful comment

Maybe it was caused by some plugin, especially EditorConfig

That's it. Remove EditorConfig - problem solved.

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings