The experimental formatter introduces a new element category called preserve space, which preserves all white spaces within the specified element tag. Currently, when preserveEmptyContent = true, it has the same behavior as preserve space, making this setting redundant.
Note: consider its behavior when used alongside with other settings:
https://github.com/redhat-developer/vscode-xml/blob/main/docs/Formatting.md#xmlformatpreservednewlines
- preservedNewLines: this setting is already prioritized over
preserveEmptyContent, it's behavior would be unaffected with the removal of preserveEmptyContent. It formats the xml nicely while allowing the user to set a specified number of new lines they would like to keep.
Example:
Before with preservedNewLines = 2:
<foo>
test1 test2
test3
</foo>
After:
<foo>
test1 test2
test3
</foo>
https://github.com/redhat-developer/vscode-xml/blob/main/docs/Formatting.md#xmlformatjoincontentlines
- joinContentLines If an user wants to normalize the white spaces with in an empty tag, they can use
xml.format.joinContentLines instead, which currently has lower priority compared to preserveEmptyContent and the preserve space category.
Example:
Before with joinContentLines = true and preserveEmptyContent = false:
After:
The experimental formatter introduces a new element category called
preserve space, which preserves all white spaces within the specified element tag. Currently, whenpreserveEmptyContent = true, it has the same behavior aspreserve space, making this setting redundant.Note: consider its behavior when used alongside with other settings:
https://github.com/redhat-developer/vscode-xml/blob/main/docs/Formatting.md#xmlformatpreservednewlines
preserveEmptyContent, it's behavior would be unaffected with the removal ofpreserveEmptyContent. It formats the xml nicely while allowing the user to set a specified number of new lines they would like to keep.Example:
Before with
preservedNewLines = 2:After:
https://github.com/redhat-developer/vscode-xml/blob/main/docs/Formatting.md#xmlformatjoincontentlines
xml.format.joinContentLinesinstead, which currently has lower priority compared topreserveEmptyContentand thepreserve spacecategory.Example:
Before with
joinContentLines = trueandpreserveEmptyContent = false:After: