Add auto-insertion support for quotes and tag closing - #1170
Merged
Merged
Conversation
angelozerr
force-pushed
the
feature/auto-insert
branch
from
September 12, 2026 17:21
ca9ec96 to
02c02f1
Compare
angelozerr
marked this pull request as ready for review
September 12, 2026 17:23
angelozerr
force-pushed
the
feature/auto-insert
branch
from
September 14, 2026 13:17
02c02f1 to
e814caa
Compare
datho7561
approved these changes
Sep 14, 2026
datho7561
left a comment
Contributor
There was a problem hiding this comment.
Looks good and works well. There's an unused import in the file that was modified, so once that's fixed you can merge.
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
force-pushed
the
feature/auto-insert
branch
from
September 14, 2026 18:48
e814caa to
1046a07
Compare
Contributor
Author
|
Thanks @datho7561 for your review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
xml/closeTagwith a newxml/autoInsertcustom LSP request that supports two kinds of auto-insertion:>or/, and when removing/from a self-closing tag (#1505)=for attribute values (Add Documentation for the XML Extension TypeScript API #342)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: