fix(svelte): format queries

This commit is contained in:
themixednuts 2026-03-24 16:05:52 -05:00
parent a1bee9959b
commit 2eb737dc68
2 changed files with 79 additions and 33 deletions

View file

@ -16,15 +16,23 @@
property: (tag_member) @tag)
(attribute_directive) @keyword
(attribute_name ":" @punctuation.delimiter)
(attribute_name
":" @punctuation.delimiter)
(attribute_identifier) @property
(attribute_modifier) @attribute
(attribute_modifiers "|" @punctuation.delimiter)
(attribute_modifiers
"|" @punctuation.delimiter)
(expression) @embedded
(expression_value) @embedded
(shorthand_attribute content: (_) @variable)
(shorthand_attribute
content: (_) @variable)
[
"{"
@ -33,8 +41,11 @@
"|" @punctuation.delimiter
(tag_comment kind: (line_comment) @comment)
(tag_comment kind: (block_comment) @comment)
(tag_comment
kind: (line_comment) @comment)
(tag_comment
kind: (block_comment) @comment)
[
"if"
@ -52,29 +63,56 @@
] @keyword.control
(block_keyword) @keyword.control
(block_open) @tag.delimiter
(block_close) @tag.delimiter
(shorthand_kind) @keyword.control
(branch_kind) @keyword.control
(block_sigil) @keyword.control
(if_block expression: (expression) @embedded)
(else_if_clause expression: (expression_value) @embedded)
(if_block
expression: (expression) @embedded)
(each_block expression: (expression) @embedded)
(each_block binding: (pattern) @variable)
(each_block index: (pattern) @variable)
(each_block key: (expression) @embedded)
(else_if_clause
expression: (expression_value) @embedded)
(await_block expression: (expression) @embedded)
(await_branch (pattern) @variable)
(await_block (pattern) @variable)
(orphan_branch (pattern) @variable)
(each_block
expression: (expression) @embedded)
(key_block expression: (expression) @embedded)
(each_block
binding: (pattern) @variable)
(each_block
index: (pattern) @variable)
(each_block
key: (expression) @embedded)
(await_block
expression: (expression) @embedded)
(await_branch
(pattern) @variable)
(await_block
(pattern) @variable)
(orphan_branch
(pattern) @variable)
(key_block
expression: (expression) @embedded)
(snippet_block
name: (snippet_name) @function)
(snippet_parameters
parameter: (pattern) @variable)
(snippet_block name: (snippet_name) @function)
(snippet_parameters parameter: (pattern) @variable)
(snippet_type_parameters) @type
[

View file

@ -25,12 +25,7 @@
(#eq? @_tag "script")
(#eq? @_lang "lang")
(#not-any-of? @injection.language
"ts"
"typescript"
"text/typescript"
"js"
"javascript"
"text/javascript"))
"ts" "typescript" "text/typescript" "js" "javascript" "text/javascript"))
((element
(start_tag
@ -92,7 +87,8 @@
((attribute
(attribute_name) @_style_name
(quoted_attribute_value (attribute_value) @injection.content))
(quoted_attribute_value
(attribute_value) @injection.content))
(#eq? @_style_name "style")
(#set! injection.language "css"))
@ -117,24 +113,36 @@
(attribute_value) @injection.content)
(#set! injection.language "javascript"))
((expression content: (js) @injection.content)
((expression
content: (js) @injection.content)
(#set! injection.language "javascript"))
((expression content: (ts) @injection.content)
((expression
content: (ts) @injection.content)
(#set! injection.language "typescript"))
((shorthand_attribute content: (js) @injection.content)
((shorthand_attribute
content: (js) @injection.content)
(#set! injection.language "javascript"))
((shorthand_attribute content: (ts) @injection.content)
((shorthand_attribute
content: (ts) @injection.content)
(#set! injection.language "typescript"))
((expression_value content: (js) @injection.content)
((expression_value
content: (js) @injection.content)
(#set! injection.language "javascript"))
((expression_value content: (ts) @injection.content)
((expression_value
content: (ts) @injection.content)
(#set! injection.language "typescript"))
((pattern content: (js) @injection.content)
((pattern
content: (js) @injection.content)
(#set! injection.language "javascript"))
((pattern content: (ts) @injection.content)
((pattern
content: (ts) @injection.content)
(#set! injection.language "typescript"))
((snippet_type_parameters) @injection.content