Skip to content

add support for xml language - #887

Open
mazunki wants to merge 2 commits into
nvim-treesitter:mainfrom
mazunki:lang-xml
Open

add support for xml language#887
mazunki wants to merge 2 commits into
nvim-treesitter:mainfrom
mazunki:lang-xml

Conversation

@mazunki

@mazunki mazunki commented May 12, 2026

Copy link
Copy Markdown

I was undecided between function and class for tags here. Ideally they should just be called @tag I feel like, but alas, this is what HTML uses, which is why I went with that.

Related to nvim-mini/mini.nvim#2417

@mazunki
mazunki force-pushed the lang-xml branch 2 times, most recently from ad13498 to cf798a3 Compare May 12, 2026 15:28
@kiyoon

kiyoon commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator
  • attribute.inner includes the quotes. cit on id="1" leaves id= and you retype the quotes. This repo's HTML query excludes them and produces no capture for an empty value, jsx does the same.
  • comment.inner equals comment.outer. Most languages here trim the delimiters, HTML defines no inner at all. Use #offset! 0 4 0 -3, with a guard for the empty <!----> comment, where the zero-width range misbehaves
  • The _+ @function.inner pattern and the (EmptyElemTag) @function.outer pattern are redundant. tree-sitter-xml wraps all children in one content node, so both duplicate the pattern above them.

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.

2 participants