question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode will insert an empty line to .editorconfig in spite of insert_final_newline = false

See original GitHub issue

Please 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 ran editorconfig [file-in-question] and the configuration was what I expected. If not, please file on the editorconfig-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

  1. Create an .editorconfig in the root
  2. Save
  3. Remove the appended empty line
  4. Save again

Related: #153

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jednanocommented, Dec 25, 2018

@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.

1reaction
jednanocommented, Dec 24, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found