Debian Codegraph @

runtime/queries/dart/highlights.scm

raw symbols SCIP
1 (dotted_identifier_list) @string
2
3 ; Methods
4 ; --------------------
5 (super) @function.builtin
6
7 (function_expression_body (identifier) @function.method)
8 ((identifier) @function.method (selector (argument_part)))
9
10 ; Annotations
11 ; --------------------
12 (annotation
13 name: (identifier) @attribute)
14
15 ; Types
16 ; --------------------
17 (class_definition
18 name: (identifier) @type)
19
20 ; Dart 3 extension types and extensions
21 (extension_type_declaration
22 name: (identifier) @type)
23 (extension_declaration
24 name: (identifier) @type)
25 (representation_declaration
26 name: (identifier) @variable.other.member)
27
28 (constructor_signature
29 name: (identifier) @function.method)
30
31 (function_signature
32 name: (identifier) @function.method)
33
34 (getter_signature
35 (identifier) @function.builtin)
36
37 (setter_signature
38 name: (identifier) @function.builtin)
39
40 (enum_declaration
41 name: (identifier) @type)
42
43 (enum_constant
44 name: (identifier) @type.builtin)
45
46 (void_type) @type.builtin
47
48 ((scoped_identifier
49 scope: (identifier) @type)
50 (#match? @type "^[a-zA-Z]"))
51
52 ((scoped_identifier
53 scope: (identifier) @type
54 name: (identifier) @type)
55 (#match? @type "^[a-zA-Z]"))
56
57 ; the DisabledDrawerButtons in : const DisabledDrawerButtons(history: true),
58 (type_identifier) @type.builtin
59
60 ; Variables
61 ; --------------------
62 ; the "File" in var file = File();
63 ((identifier) @namespace
64 (#match? @namespace "^_?[A-Z].*[a-z]")) ; catch Classes or IClasses not CLASSES
65
66 ("Function" @type.builtin)
67 (inferred_type) @type.builtin
68
69 ; properties
70 (unconditional_assignable_selector
71 (identifier) @variable.other.member)
72
73 (conditional_assignable_selector
74 (identifier) @variable.other.member)
75
76 ; assignments
77 ; --------------------
78 ; the "strings" in : strings = "some string"
79 (assignment_expression
80 left: (assignable_expression) @variable)
81
82 (this) @variable.builtin
83
84 ; Parameters
85 ; --------------------
86 (formal_parameter
87 name: (identifier) @variable)
88
89 (named_argument
90 (label (identifier) @variable))
91
92 ; Dart 3 dot-shorthand (`.red`): the member resolved from the context type.
93 (dot_shorthand
94 (identifier) @variable.other.member)
95
96 ; Statement labels (`outer:` … `break outer;`).
97 (labeled_statement
98 (identifier) @label)
99
100 ; Literals
101 ; --------------------
102 [
103 (hex_integer_literal)
104 (decimal_integer_literal)
105 (decimal_floating_point_literal)
106 ;(octal_integer_literal)
107 ;(hex_floating_point_literal)
108 ] @constant.numeric.integer
109
110 (symbol_literal) @string.special.symbol
111 (string_literal) @string
112
113 [
114 (const_builtin)
115 (final_builtin)
116 ] @variable.builtin
117
118 [
119 (true)
120 (false)
121 ] @constant.builtin.boolean
122
123 (null_literal) @constant.builtin
124
125 (comment) @comment.line
126 (documentation_comment) @comment.block.documentation
127
128 ; Tokens
129 ; --------------------
130 (template_substitution
131 "$" @punctuation.special
132 "{" @punctuation.special
133 "}" @punctuation.special
134 ) @embedded
135
136 (template_substitution
137 "$" @punctuation.special
138 (identifier_dollar_escaped) @variable
139 ) @embedded
140
141 (escape_sequence) @constant.character.escape
142
143 ; Punctuation
144 ;---------------------
145 [
146 "("
147 ")"
148 "["
149 "]"
150 "{"
151 "}"
152 ] @punctuation.bracket
153
154 [
155 ";"
156 "."
157 ","
158 ":"
159 ] @punctuation.delimiter
160
161 ; Operators
162 ;---------------------
163 [
164 "@"
165 "?"
166 "=>"
167 ".."
168 "=="
169 "&&"
170 "%"
171 "<"
172 ">"
173 "="
174 ">="
175 "<="
176 "||"
177 (multiplicative_operator)
178 (increment_operator)
179 (is_operator)
180 (prefix_operator)
181 (equality_operator)
182 (additive_operator)
183 ] @operator
184
185 ; Keywords
186 ; --------------------
187 ["import" "library" "export"] @keyword.control.import
188 ["do" "while" "continue" "for"] @keyword.control.repeat
189 ["return" "yield"] @keyword.control.return
190 ["as" "in" "is"] @keyword.operator
191
192 [
193 "?."
194 "??"
195 "if"
196 "else"
197 "switch"
198 "default"
199 "late"
200 ] @keyword.control.conditional
201
202 [
203 "try"
204 "throw"
205 "catch"
206 "finally"
207 (rethrow_builtin)
208 (break_statement)
209 ] @keyword.control.exception
210
211 ; Reserved words (cannot be used as identifiers)
212 [
213 (case_builtin)
214 (assert_builtin)
215 (part_of_builtin)
216 "abstract"
217 "async"
218 "async*"
219 "await"
220 "base"
221 "class"
222 "covariant"
223 "deferred"
224 "enum"
225 "extends"
226 "extension"
227 "external"
228 "factory"
229 "final"
230 "Function"
231 "get"
232 "implements"
233 "interface"
234 "mixin"
235 "new"
236 "on"
237 "operator"
238 "part"
239 "required"
240 "sealed"
241 "set"
242 "show"
243 "static"
244 "super"
245 "sync*"
246 "typedef"
247 "with"
248 ] @keyword
249
250 ; when used as an identifier:
251 ((identifier) @variable.builtin
252 (#match? @variable.builtin "^(abstract|as|base|covariant|deferred|export|external|factory|final|Function|get|implements|import|interface|library|operator|mixin|part|sealed|set|static|typedef)$"))