Debian Codegraph @

runtime/queries/wgsl/highlights.scm

raw symbols SCIP
1 (int_literal) @constant.numeric.integer
2 (float_literal) @constant.numeric.float
3 (bool_literal) @constant.builtin.boolean
4
5 [
6 "bitcast"
7 "discard"
8 "enable"
9 "fallthrough"
10 ] @keyword
11
12 [
13 "let"
14 "override"
15 "struct"
16 "type"
17 "var"
18 (texel_format)
19 ] @keyword.storage.type
20
21 [
22 (access_mode)
23 (address_space)
24 ] @keyword.storage.modifier
25
26 "fn" @keyword.function
27
28 "return" @keyword.control.return
29
30 ["," "." ":" ";"] @punctuation.delimiter
31
32 ["(" ")" "[" "]" "{" "}"] @punctuation.bracket
33
34 [
35 "break"
36 "continue"
37 "continuing"
38 ] @keyword.control
39
40 [
41 "loop"
42 "for"
43 "while"
44 ] @keyword.control.repeat
45
46 [
47 "if"
48 "else"
49 "switch"
50 "case"
51 "default"
52 ] @keyword.control.conditional
53
54 [
55 "!"
56 "!="
57 "%"
58 "%="
59 "&"
60 "&&"
61 "&="
62 "*"
63 "*="
64 "+"
65 "++"
66 "+="
67 "-"
68 "--"
69 "-="
70 "->"
71 "/"
72 "/="
73 "<"
74 "<<"
75 "<="
76 "="
77 "=="
78 ">"
79 ">="
80 ">>"
81 "@"
82 "^"
83 "^="
84 "|"
85 "|="
86 "||"
87 "~"
88 ] @operator
89
90 (identifier) @variable
91
92 (function_declaration
93 (identifier) @function)
94
95 (parameter
96 (variable_identifier_declaration
97 (identifier) @variable.parameter))
98
99 (struct_declaration
100 (identifier) @type)
101
102 (struct_declaration
103 (struct_member
104 (variable_identifier_declaration
105 (identifier) @variable.other.member)))
106
107 (type_declaration _ @type)
108
109 ; A call/constructor callee (the identifier inside the call's type_declaration)
110 ; is a function — must come after the generic type_declaration rule above, which
111 ; otherwise paints the callee @type.
112 (type_constructor_or_function_call_expression
113 (type_declaration (identifier) @function))
114
115 ; Member access: obj.field
116 (composite_value_decomposition_expression
117 accessor: (identifier) @variable.other.member)
118
119 (attribute
120 (identifier) @attribute)
121
122 (comment) @comment
123
124 ; built-in wgsl functions: https://webgpufundamentals.org/webgpu/lessons/webgpu-wgsl-function-reference.html
125 (
126 (identifier) @function.builtin
127 (#any-of? @function.builtin
128 "abs"
129 "abs"
130 "acos"
131 "acosh"
132 "all"
133 "any"
134 "arrayLength"
135 "asin"
136 "asinh"
137 "atan"
138 "atan2"
139 "atanh"
140 "atomicAdd"
141 "atomicLoad"
142 "atomicStore"
143 "bitcast"
144 "ceil"
145 "clamp"
146 "cos"
147 "cosh"
148 "countLeadingZeros"
149 "countOneBits"
150 "countTrailingZeros"
151 "cross"
152 "degrees"
153 "determinant"
154 "distance"
155 "dot"
156 "dpdx"
157 "dpdxCoarse"
158 "dpdxFine"
159 "dpdy"
160 "dpdyCoarse"
161 "dpdyFine"
162 "exp"
163 "exp2"
164 "extractBits"
165 "faceForward"
166 "firstLeadingBit"
167 "firstTrailingBit"
168 "floor"
169 "fma"
170 "fract"
171 "frexp"
172 "fwidth"
173 "fwidthCoarse"
174 "fwidthFine"
175 "gather_depth_compare"
176 "gather_x_components"
177 "insertBits"
178 "inverseSqrt"
179 "ldexp"
180 "length"
181 "log"
182 "log2"
183 "max"
184 "min"
185 "mix"
186 "modf"
187 "normalize"
188 "pack2x16float"
189 "pack2x16snorm"
190 "pack2x16unorm"
191 "pack4x8snorm"
192 "pack4x8unorm"
193 "pow"
194 "quantizeToF16"
195 "radians"
196 "reflect"
197 "refract"
198 "reverseBits"
199 "round"
200 "saturate"
201 "select"
202 "sign"
203 "sin"
204 "sinh"
205 "smoothstep"
206 "sqrt"
207 "step"
208 "storageBarrier"
209 "tan"
210 "tanh"
211 "textureDimensions"
212 "textureGather"
213 "textureGatherCompare"
214 "textureLoad"
215 "textureNumLayers"
216 "textureNumLevels"
217 "textureNumSamples"
218 "textureSample"
219 "textureSampleBaseClampToEdge"
220 "textureSampleBias"
221 "textureSampleCompare"
222 "textureSampleCompareLevel"
223 "textureSampleGrad"
224 "textureSampleLevel"
225 "textureStore"
226 "transpose"
227 "trunc"
228 "unpack2x16float"
229 "unpack2x16snorm"
230 "unpack2x16unorm"
231 "unpack4x8snorm"
232 "unpack4x8unorm"
233 "workgroupBarrier"
234 "workgroupUniformLoad"
235 )
236 )
237
238 (type_declaration ["<" ">"] @punctuation.bracket)
239 (variable_qualifier ["<" ">"] @punctuation.bracket)