1
0
mirror of https://github.com/helix-editor/helix synced 2026-03-11 22:38:26 +01:00
helix/runtime/queries/_gjs/injections.scm
Michael Davis 3ec47beb23
queries: Fix glimmer template string injection in gjs
This was using the old Neovim syntax for injections which used captures
of the injection language on the injection content node. These days both
Helix and Neovim use injection.content and injection.language captures /
settings.
2025-11-24 09:55:52 -05:00

22 lines
705 B
Scheme

; PARSE GLIMMER TEMPLATES
(call_expression
function: [
(identifier) @injection.language
(member_expression
property: (property_identifier) @injection.language)
]
arguments: (template_string) @injection.content)
; e.g.: <template><SomeComponent @arg={{double @value}} /></template>
((glimmer_template) @injection.content
(#set! injection.language "glimmer")
(#set! injection.include-children))
; Parse Ember/Glimmer/Handlebars/HTMLBars/etc. template literals
; e.g.: await render(hbs`<SomeComponent />`)
((call_expression
function: ((identifier) @_name
(#eq? @_name "hbs"))
arguments: (template_string) @injection.content)
(#set! injection.language "glimmer"))