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

Formatter expand/collapse/ignore empty XML tags #241

Closed

Conversation

angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Apr 18, 2020

Formatter expand/collapse/ignore empty XML tags

See #219

Signed-off-by: azerr azerr@redhat.com

package.json Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@angelozerr angelozerr force-pushed the format-empty-tag branch 4 times, most recently from 15f2d5c to 682380d Compare April 20, 2020 13:22
@angelozerr angelozerr changed the title Formatter expand/collapse/none empty XML tags Formatter expand/collapse/ignore empty XML tags Apr 20, 2020
@xorye
Copy link

xorye commented Apr 20, 2020

I found a minor edge case when I set xml.format.emptyElements to collapse:

range formatting

After range formatting, I think the result should be:

<a>
    <b>
</b>
</a>

as only the starting tag was to be formatted

@fbricon
Copy link
Collaborator

fbricon commented Apr 20, 2020

@angelozerr please see if this is fixable. maybe don't do the collapsing/expansion if the selection is not self-contained, i.e it's malformed on its own.

See redhat-developer#219

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
Copy link
Contributor Author

I close this PR for #242 (I had some trouble with Eclipse Egit NPE bug)

@angelozerr angelozerr closed this Apr 21, 2020
@angelozerr
Copy link
Contributor Author

I found a minor edge case when I set xml.format.emptyElements to collapse:

Good catch!

@angelozerr please see if this is fixable. maybe don't do the collapsing/expansion if the selection is not self-contained, i.e it's malformed on its own.

I fixed this issue, if element is not closed (when range doesn't cover the whole element, the collapse/expand is ignored for this element

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

Successfully merging this pull request may close these issues.

3 participants