mirror of
https://github.com/laosb/SvelteNova.git
synced 2025-04-30 20:51:10 +00:00
feat: (Not working) injections.
This commit is contained in:
parent
59d04f7797
commit
554463eb63
2 changed files with 32 additions and 0 deletions
31
SvelteNova.novaextension/Queries/injections.scm
Normal file
31
SvelteNova.novaextension/Queries/injections.scm
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
; This query file is adopted from https://github.com/Himujjal/tree-sitter-svelte/blob/master/queries/injections.scm.
|
||||||
|
; Nova's injection captures are different from the original one.
|
||||||
|
|
||||||
|
(style_element
|
||||||
|
(raw_text
|
||||||
|
(#set! injection.language css)
|
||||||
|
) @injection.content
|
||||||
|
)
|
||||||
|
|
||||||
|
; ((attribute
|
||||||
|
; (attribute_name) @_attr
|
||||||
|
; (quoted_attribute_value (attribute_value) @css))
|
||||||
|
; (#eq? @_attr "style"))
|
||||||
|
;
|
||||||
|
; ((script_element
|
||||||
|
; (raw_text) @javascript))
|
||||||
|
;
|
||||||
|
(raw_text_expr
|
||||||
|
(#set! injection.language javascript)
|
||||||
|
) @injection.content
|
||||||
|
|
||||||
|
(script_element
|
||||||
|
(start_tag
|
||||||
|
(attribute
|
||||||
|
(attribute_name @_attr)
|
||||||
|
(quoted_attribute_value (attribute_value) @injection.language)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(raw_text) @injection.content
|
||||||
|
; (#eq? @_attr "lang"))
|
||||||
|
)
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
<tree-sitter>
|
<tree-sitter>
|
||||||
<highlights />
|
<highlights />
|
||||||
|
<injections />
|
||||||
</tree-sitter>
|
</tree-sitter>
|
||||||
|
|
||||||
<detectors>
|
<detectors>
|
||||||
|
|
Loading…
Add table
Reference in a new issue