add support for tree-sitter custom template languages on vue (#13511)

Co-authored-by: TheSylex <TheSylex@users.noreply.github.com>
pull/12884/merge
Aitor 2025-05-12 15:23:59 +02:00 committed by GitHub
parent 63a1a94d92
commit 908b9edf28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 0 deletions

View File

@ -40,5 +40,21 @@
(raw_text) @injection.content)
(#eq? @_attr_name "lang"))
; <template>
((template_element
(start_tag) @_no_lang
(text) @injection.content)
(#not-match? @_no_lang "lang=")
(#set! injection.language "html"))
; <template lang="...">
((template_element
(start_tag
(attribute
(attribute_name) @_attr_name
(quoted_attribute_value (attribute_value) @injection.language)))
(text) @injection.content)
(#eq? @_attr_name "lang"))
((comment) @injection.content
(#set! injection.language "comment"))