-
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
feat: add support for files.insertFinalNewline during formatOnSave #13751
base: master
Are you sure you want to change the base?
Conversation
@xai What is the state of this? |
As I commented in the related issue, I feel that the added protected function might be living in the wrong place. But it works, and I do not know what would be a better file/package for that function, so I am just going to remove the draft state now and hope for input from a reviewer. |
@tsmaeder alerted me that the property seems to be ignored in certain cases:
Merging as is does not make sense, because it will not work in most cases (i.e., all built-in extensions are present). So, I am going to debug into this to find out which extension we are having this feature interaction with. |
FYI: I am retesting this right now ... Edit: If your workspace contains a |
Just rebased against master, above comment still applies. |
When the `files.insertFinalNewline` property is set to true, formatOnSave() will ensure that the file ends with a newline character instead of always removing a final empty line. Contributed on behalf of STMicroelectronics Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>
So, what is the expected behavior if a generic Theia workspace setting such as |
What it does
When the
files.insertFinalNewline
property is set to true, formatOnSave() will ensure that the file ends with a newline character instead of always removing a final empty line.Fixes #13475
Contributed on behalf of STMicroelectronics
How to test
"editor.formatOnSave"
totrue
in the workspace settings."files.insertFinalNewline"
totrue
in the workspace settings.Follow-ups
Review checklist
Reminder for reviewers