-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
JSON formatter removes newline at end of file #176246
Comments
This is controlled by the setting |
No, that's completely different. I don't want any changes to happen at the time of saving the file. The formatter actually removes the newline if it was previously present. Reopen. |
The setting is not only used on save, but also observed by formatters. |
Oh, if you want the JSON formatter to preserve all new lines (including the one at the end of the line) you can also set the setting |
Ok, it's nice that the formatter observes Enabling In any case, a text file without a final newline is malformed and I don't believe that in the default configuration, the JSON formatter should output a malformed document. |
|
Then, the None of the settings you suggested solved the issue, as I explained. Even if we pretended that whether or not there should be newline at the end is a guideline (it's not), the formatter doesn't have to add it, but it definitely shouldn't remove it, which it does. So why are you so insistent on not fixing this bug? It would probably be a one-line fix. How about this: instead of the formatter deciding whether to add it based on the |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
All text files are supposed to end with a newline character.
The text was updated successfully, but these errors were encountered: