redhat-developer / redhat-developer/vscode-xml

Ending empty line is always deleted

Open
#973 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug formatting
Dominant language
TypeScript
Stars
328
Forks
101
Avg merge
1d 17h
Merged PRs (30d)
7

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the XML formatter entry point and the implementation of the xml.format.preserveAttributeLineBreaks and xml.format.preservedNewlines settings. Reproduce formatting an XML document with an ending empty line using the settings from the report. Done means the formatter preserves the configured ending newlines or the behavior is controlled by a documented new setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.