Skip to content

Add auto-insertion support for quotes and tag closing - #1170

Merged
angelozerr merged 1 commit into
redhat-developer:mainfrom
angelozerr:feature/auto-insert
Sep 14, 2026
Merged

angelozerr merged 1 commit into
redhat-developer:mainfrom
angelozerr:feature/auto-insert

Conversation

@angelozerr

@angelozerr angelozerr commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Replace xml/closeTag with a new xml/autoInsert custom LSP request that supports two kinds of auto-insertion:

Also handles the deletion case (removing '/' from ) by detecting when a deletion leaves '>' as the character before the cursor.

Adds new setting xml.completion.autoCreateQuotes (default: true).

Fixes eclipse-lemminx/lemminx#1505, eclipse-lemminx/lemminx#342

This PR requires eclipse-lemminx/lemminx#1849

Here a demo:

AutoClose

@datho7561 datho7561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good and works well. There's an unused import in the file that was modified, so once that's fixed you can merge.

Comment thread src/client/xmlClient.ts Outdated
Replace tagClosing.ts with autoInsertion.ts that uses the new
xml/autoInsert LSP request instead of xml/closeTag. Supports two kinds:
- autoClose: auto-close tags on '>' or '/' (existing behavior)
- autoQuote: auto-insert quotes after '=' for attribute values (new)

Also handles the deletion case (removing '/' from <tag/>) by detecting
when a deletion leaves '>' as the character before the cursor.

Adds new setting xml.completion.autoCreateQuotes (default: true).

Fixes eclipse-lemminx/lemminx#1505, eclipse-lemminx/lemminx#342

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
angelozerr merged commit 4424715 into redhat-developer:main Sep 14, 2026
6 checks passed
@angelozerr

Copy link
Copy Markdown
Contributor Author

Thanks @datho7561 for your review!

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.

AutoOpen closed Tags

2 participants