VSCode will insert an empty line to .editorconfig in spite of insert_final_newline = false
See original GitHub issuePlease fill-in this template.
- I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
- I tried running
code --disable-extensions
and the issue did NOT present itself.
Delete the following condition if it doesn’t apply to your case:
If the extension is not picking up the expected configuration for a file:
- I tried
npm install editorconfig -g
and raneditorconfig [file-in-question]
and the configuration was what I expected. If not, please file on theeditorconfig-core-js
issue tracker.
Issue
Visual Studio Code | editorconfig-vscode | |
---|---|---|
Version | 1.30.1 |
0.12.5 |
Root .editorconfig
File
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = false
trim_trailing_whitespace = true
[*.py]
indent_size = 4
[*.md]
trim_trailing_whitespace = false
[{Makefile,Makefile*,*.mk}]
indent_style = tab
indent_size = 4
tab_width = 4
Are there any other relevant .editorconfig
files in your project? Yes / No
Visual Studio Code Setting | Default | User | Workspace |
---|---|---|---|
editor.insertSpaces |
true |
true |
____ |
editor.tabSize |
4 |
4 |
_ |
editor.trimAutoWhitespace |
true |
true |
____ |
files.autoSave |
"off" |
"off" |
"___" |
files.insertFinalNewline |
false |
true |
_____ |
files.trimTrailingWhitespace |
false |
true |
_____ |
File opened
./.editorconfig
Expected behavior
insert_final_newline = false
Actual behavior
insert_final_newline = true
Additional comments or steps to reproduce
- Create an
.editorconfig
in the root - Save
- Remove the appended empty line
- Save again
Related: #153
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Why does the editor insert a final newline for JSON files ...
This is the VS Code configuration: "files.insertFinalNewline": false,. When selecting all content of package.
Read more >Visual Studio Code Frequently Asked Questions
If VS Code is displaying a blank (empty) main window, you can try disabling GPU acceleration when launching VS Code by adding the...
Read more >detected local configuration (i.e. .prettierrc or .editorconfig), vs ...
The solution for ” No local configuration (i.e. .prettierrc or .editorconfig) detected, falling back to VS Code configuration prettier ” can be found...
Read more >Configuring Visual Studio Code | Editors and IDEs - Drupal
Visual Studio Code (VS Code) is Microsoft's cross-platform free, open source integrated development environment (IDE)
Read more >Stop VSCode from removing newlines at the end of file - Reddit
A language formatter does this. Prettier, for example, will leave one new line at the bottom of a file. If it's leaving one...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tats-u the more and more I look into this issue, the more I’m convinced it should be fixed first at the vscode level. I opened an issue about it here.
You’re right that we just need to let Code do what Code does and not get in its way. I’ll look into this more when I have some time and of course PRs welcome.