-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Formatter removes final newline on package.json #13475
Comments
In current version of VS Code, there seems to be a setting |
I cannot reproduce this on current master. |
@xai are you using the a Theia workspace to test? "Format on save" is turned on in the workspace settings. I just observed this again in the Theia IDE 1.47.100. |
I can reproduce this now (with Theia IDE 1.49.101). |
Unfortunately, Monaco Editor has no such thing as I opened a draft PR with a workaround to support the |
Do we understand why the formatter removes the final newline? As far as I can tell, this does not happen in VS Code. |
I think it does, see attached screencast. vscode-finalnewline.mp4 |
I'm sorry, but what am I seeing? |
This is vscode (cleaned user data) with a workspace that has formatOnSave enabled (see right pane). Initially, insertFinalNewline is not set (right pane). Then, I enabled the insertFinalNewline setting in the right pane and repeated the experiment with the package.json. The second save does not remove the empty line, i.e. line 46 remains. |
@xai What's the reason the PR is in draft state? |
This concern of mine was the reason I kept it in draft state. |
Bug Description:
The Theia workspace contains a setting to turn on "format on save" for the workspace. This is problematic, since the formatter does not work as intended: if I edit a package.json file, the formatter will remove the final newline. This leads to problems on UNIX-derived platforms.
Steps to Reproduce:
Additional Information
The text was updated successfully, but these errors were encountered: