Skip to content

Code removes newline at the end of .json files #109649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
moi90 opened this issue Oct 29, 2020 · 1 comment
Closed

Code removes newline at the end of .json files #109649

moi90 opened this issue Oct 29, 2020 · 1 comment
Assignees

Comments

@moi90
Copy link

moi90 commented Oct 29, 2020

  • VSCode Version: 1.50.1
  • OS Version: Ubuntu 18.04.5 LTS

Steps to Reproduce:

  1. Start without extensions: code --disable-extensions
  2. Open JSON file. Add newlines at the end of the file.
  3. "Format Document".

The newlines are gone.

Does this issue occur when all extensions are disabled?: Yes.

Settings:

{
"files.trimFinalNewlines": false,
}
@aeschli
Copy link
Contributor

aeschli commented Oct 29, 2020

The JSON formatter removes all 'unnecessary' new lines.

The request to preserve new lines is #23260

@aeschli aeschli closed this as completed Oct 29, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants