Skip to content
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

Ending empty line is always deleted #973

Open
davidavetyan opened this issue Mar 1, 2024 · 3 comments
Open

Ending empty line is always deleted #973

davidavetyan opened this issue Mar 1, 2024 · 3 comments

Comments

@davidavetyan
Copy link

After formatting any XML document, the empty line at the end is always removed.
This happens even if the following extension settings are set:

xml.format.preserveAttributeLineBreaks: true
xml.format.preservedNewlines: 2

Either the formatter should respect the xml.format.preservedNewlines value when formatting the ending lines, or a new setting should be added to control this behavior.

@pbodnar
Copy link

pbodnar commented Apr 12, 2024

I've just run into this problem. From my tests, it seems like the formatter honors what is being set in the files.insertFinalNewline VS Code setting. If this is set to true, the formatter no longer removes the ending EOL - so that is one way of how to workaround the problem.

Yet, I believe this really is an error and the formatter should rather leave the end of the file as-is. And that there is probably no need to introduce any setting for this, or is it?

@angelozerr
Copy link
Contributor

Of I remember we use the settings from vscode like @pbodnar said

@gk-bbai
Copy link

gk-bbai commented Jun 21, 2024

It should prioritize the insert_final_newline value in .editorconfig over the VS Code default setting.

If a user uses .editorconfig then they most likely won't bother setting files.insertFinalNewline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants