Files
helix/runtime/queries/templ/textobjects.scm
mayandGitHub 5a3edd585e feat(templ): improve the queries (#15668)
* chore(lang/go): update source to the latest revision

* chore(lang/templ): update source to the newest revision

* feat(tags/templ): add tags query

* feat(injections/templ): inherit from go, inject comment

* feat(textobjects/templ): add textobject queries

inherit from go and add the additional templ-only textobject queries for
`@comment` and `@function`.

* fix(highlights/templ): fix and align templ highlight queries

- only mark the names of tags as `@tag`
- also correctly highlight the script tag
- mark <, </, >, /> as `@punctuation.bracket`
- don't mark interpolation expressions as `@function.member`
- highlight {{ and }} as brackets
- mark css properties as members like the css highlights do
- don't highlight the (element_text) nodes
- remove duplicate tags from the go queries

* feat(highlights/templ): add special highlighting to specific elements

this is mostly taken from the html queries, but adjusted to the templ
queries.

* feat(rainbows/templ): add rainbow queries

* chore: cargo xtask docgen
2026-07-04 12:28:19 -05:00

25 lines
661 B
Scheme

; inherits: go
(style_element) @xml-element.around
(style_element
[(self_closing_style_tag) (style_element_text)] @xml-element.inside)
(script_element) @xml-element.around
(script_element
[(script_element_text) (self_closing_script_tag)] @xml-element.inside)
(element) @xml-element.around
(element (self_closing_tag) @xml-element.inside)
(element (tag_start) (_)* @xml-element.inside (tag_end))
(element_comment) @comment.around
(component_declaration
(component_block) @function.inside) @function.around
; TODO: function.inside textobjects
(css_declaration) @function.around
(script_declaration
(script_block) @function.inside) @function.around