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

Support identation for XML contributed languages #862

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

angelozerr
Copy link
Contributor

Support identation for XML contributed languages

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

There is a bug with linked editing that makes proper tag indentation very annoying. For instance, if you have an .svg document:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.w3.org/2000/svg https://www.w3.org/TR/2002/WD-SVG11-20020108/SVG.xsd">
  |
</svg>

If you add a tag <aaa> at the |, hit enter, then type in </aaa>, it will remove content from the opening tag when you type the last >.

This behaviour doesn't happen when you have tag auto closing, since the indentation isn't triggered if you have auto tag closing (eg. in xml and xsd files), but .svg files don't have auto indentation configured by default. However, if you disable auto tag closing, you can see the behaviour in XML and XSD files as well.

@datho7561
Copy link
Contributor

broken-indentation

@angelozerr
Copy link
Contributor Author

@datho7561 I created a PR to try to fix issue with linked editing range at eclipse/lemminx#1457

But the bug that you found is not related to this vscode-xml PR indentation.

Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks, Angelo!

@datho7561 datho7561 added the bug Something isn't working label Jan 24, 2023
@datho7561 datho7561 added this to the 0.24.0 milestone Jan 24, 2023
@datho7561 datho7561 merged commit a179451 into redhat-developer:main Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants