Refine svelte queries to work with zed-style highlights

Bump scheme dependency:
This commit is contained in:
Mikayla Maki 2023-07-13 22:30:41 -07:00
parent 1424a7a56a
commit ff8a89a075
No known key found for this signature in database
5 changed files with 52 additions and 71 deletions

View file

@ -1,5 +1,35 @@
; Special identifiers
;--------------------
; TODO:
(tag_name) @tag
(attribute_name) @property
(erroneous_end_tag_name) @keyword
(comment) @comment
[
(attribute_value)
(quoted_attribute_value)
] @string
[
(text)
(raw_text_expr)
] @none
[
(special_block_keyword)
(then)
(as)
] @keyword
[
"{"
"}"
] @punctuation.bracket
"=" @operator
[
"<"
">"
@ -10,59 +40,3 @@
"/"
"@"
] @tag.delimiter
[
"{"
"}"
] @punctuation.bracket
[
(special_block_keyword)
(then)
(as)
] @keyword
[
(text)
(raw_text_expr)
] @none
[
(attribute_value)
(quoted_attribute_value)
] @string
(tag_name) @tag
(attribute_name) @property
(erroneous_end_tag_name) @error
(comment) @comment
((attribute
(attribute_name) @_attr
(quoted_attribute_value (attribute_value) @text.uri))
(#match? @_attr "^(href|src)$"))
; TODO:
((element (start_tag (tag_name) @_tag) (text) @text.uri)
(#eq? @_tag "a"))
((element (start_tag (tag_name) @_tag) (text) @text.literal)
(#match? @_tag "^(code|kbd)$"))
((element (start_tag (tag_name) @_tag) (text) @text.underline)
(#eq? @_tag "u"))
((element (start_tag (tag_name) @_tag) (text) @text.strike)
(#match? @_tag "^(s|del)$"))
((element (start_tag (tag_name) @_tag) (text) @text.emphasis)
(#match? @_tag "^(em|i)$"))
((element (start_tag (tag_name) @_tag) (text) @text.strong)
(#match? @_tag "^(strong|b)$"))
((element (start_tag (tag_name) @_tag) (text) @text.title)
(#match? @_tag "^(h[0-9]|title)$"))
"=" @operator

View file

@ -6,15 +6,3 @@
(script_element)
(style_element)
] @indent
[
(end_tag)
(else_statement)
(if_end_expr)
(each_end_expr)
(await_end_expr)
">"
"/>"
] @branch
(comment) @ignore

View file

@ -4,6 +4,25 @@
(raw_text) @content
(#set! "language" "javascript"))
((script_element
(start_tag
(attribute
(quoted_attribute_value (attribute_value) @_language)))
(raw_text) @content)
(#eq? @_language "ts")
(#set! "language" "typescript"))
((script_element
(start_tag
(attribute
(quoted_attribute_value (attribute_value) @_language)))
(raw_text) @content)
(#eq? @_language "typescript")
(#set! "language" "typescript"))
(style_element
(raw_text) @content
(#set! "language" "css"))
((raw_text_expr) @content
(#set! "language" "javascript"))