Debian Codegraph @

runtime/queries/svelte/highlights.scm

raw symbols SCIP
1 ; Tag names
2 (tag_name) @tag
3
4 ; Erroneous/mismatched end tags
5 (erroneous_end_tag_name) @error
6
7 ; DOCTYPE declaration
8 (doctype) @constant
9
10 ; Attribute names
11 (attribute_name) @attribute
12
13 ; Attribute values
14 (attribute_value) @string
15 (quoted_attribute_value) @string
16
17 ; Comments
18 (comment) @comment
19
20 ; Character entities
21 (entity) @string.special.symbol
22
23 ; Text content
24 (text) @text
25
26 ; Raw text in script/style
27 (raw_text) @none
28
29 ; HTML punctuation
30 [
31 "<"
32 ">"
33 "</"
34 "/>"
35 "<!"
36 ] @punctuation.bracket
37
38 "=" @punctuation.delimiter
39
40 ; Component tags (PascalCase)
41 ((tag_name) @type (#match? @type "^[A-Z]"))
42
43 ; Namespaced tags (svelte:component, svelte:self, etc.)
44 (tag_name
45 namespace: (tag_namespace) @keyword
46 ":" @punctuation.delimiter
47 name: (tag_local_name) @tag)
48
49 ; Tag member access (Foo.Bar)
50 (tag_name
51 object: (tag_member) @type
52 "." @punctuation.delimiter
53 property: (tag_member) @tag)
54
55 ; Directives (on:click, bind:value, etc.)
56 (attribute_directive) @keyword
57 (attribute_name ":" @punctuation.delimiter)
58 (attribute_identifier) @property
59 (attribute_modifier) @attribute
60 (attribute_modifiers "|" @punctuation.delimiter)
61
62 ; Expressions
63 (expression) @embedded
64 (expression_value) @embedded
65
66 ; Shorthand/spread attributes
67 (shorthand_attribute content: (_) @variable)
68
69 ; Curly braces (expression context)
70 [
71 "{"
72 "}"
73 ] @punctuation.bracket
74
75 "|" @punctuation.delimiter
76
77 ; Comments inside tag attribute lists
78 (tag_comment kind: (line_comment) @comment)
79 (tag_comment kind: (block_comment) @comment)
80
81 ; Block keywords
82 [
83 "if"
84 "each"
85 "await"
86 "key"
87 "snippet"
88 "else"
89 "html"
90 "debug"
91 "const"
92 "render"
93 "attach"
94 "as"
95 ] @keyword.control
96
97 ; Block end keywords ({/if}, {/each}, etc.)
98 (block_keyword) @keyword.control
99
100 ; Block delimiters
101 (block_open) @punctuation.bracket
102 (block_close) @punctuation.bracket
103
104 (shorthand_kind) @keyword.control
105 (branch_kind) @keyword.control
106
107 ; If block
108 (if_block expression: (expression) @embedded)
109 (else_if_clause expression: (expression_value) @embedded)
110
111 ; Each block
112 (each_block expression: (expression) @embedded)
113 (each_block binding: (pattern) @variable)
114 (each_block index: (pattern) @variable)
115 (each_block key: (expression) @embedded)
116
117 ; Await block
118 (await_block expression: (expression) @embedded)
119 (await_branch (pattern) @variable)
120 (await_block (pattern) @variable)
121 (orphan_branch (pattern) @variable)
122
123 ; Key block
124 (key_block expression: (expression) @embedded)
125
126 ; Snippet block
127 (snippet_block name: (snippet_name) @function)
128 (snippet_parameters parameter: (pattern) @variable)
129 (snippet_type_parameters) @type
130
131 ; Malformed blocks
132 (block_sigil) @keyword.control
133
134 ; Snippet/render punctuation
135 [
136 "("
137 ")"
138 ","
139 ] @punctuation.delimiter