Skip to content

Support identation for XML contributed languages#862

Merged
datho7561 merged 1 commit intoredhat-developer:mainfrom
angelozerr:indent-fix
Jan 24, 2023
Merged

Support identation for XML contributed languages#862
datho7561 merged 1 commit intoredhat-developer:mainfrom
angelozerr:indent-fix

Conversation

@angelozerr
Copy link
Copy Markdown
Contributor

Support identation for XML contributed languages

@angelozerr angelozerr force-pushed the indent-fix branch 2 times, most recently from cc42121 to 96a51fa Compare January 23, 2023 15:15
@angelozerr angelozerr marked this pull request as ready for review January 23, 2023 15:16
@angelozerr angelozerr requested a review from datho7561 January 23, 2023 15:16
Signed-off-by: azerr <azerr@redhat.com>
@datho7561
Copy link
Copy Markdown
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
Copy Markdown
Contributor

broken-indentation

@angelozerr
Copy link
Copy Markdown
Contributor Author

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

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

Copy link
Copy Markdown
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.

2 participants