PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.25.0
Code Block Pro – Beautiful Syntax Highlighting v1.25.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / dart.tmLanguage.json

dart.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.25.0, at build/shiki/languages/dart.tmLanguage.json

529 lines 12.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "name": "dart",
3 "version": "1.2.2",
4 "fileTypes": ["dart"],
5 "scopeName": "source.dart",
6 "foldingStartMarker": "\\{\\s*$",
7 "foldingStopMarker": "^\\s*\\}",
8 "patterns": [
9 {
10 "name": "meta.preprocessor.script.dart",
11 "match": "^(#!.*)$"
12 },
13 {
14 "name": "meta.declaration.dart",
15 "begin": "^\\w*\\b(library|import|part of|part|export)\\b",
16 "beginCaptures": {
17 "0": {
18 "name": "keyword.other.import.dart"
19 }
20 },
21 "end": ";",
22 "endCaptures": {
23 "0": {
24 "name": "punctuation.terminator.dart"
25 }
26 },
27 "patterns": [
28 {
29 "include": "#strings"
30 },
31 {
32 "include": "#comments"
33 },
34 {
35 "name": "keyword.other.import.dart",
36 "match": "\\b(as|show|hide)\\b"
37 },
38 {
39 "name": "keyword.control.dart",
40 "match": "\\b(if)\\b"
41 }
42 ]
43 },
44 {
45 "include": "#comments"
46 },
47 {
48 "include": "#punctuation"
49 },
50 {
51 "include": "#annotations"
52 },
53 {
54 "include": "#keywords"
55 },
56 {
57 "include": "#constants-and-special-vars"
58 },
59 {
60 "include": "#operators"
61 },
62 {
63 "include": "#strings"
64 }
65 ],
66 "repository": {
67 "dartdoc": {
68 "patterns": [
69 {
70 "match": "(\\[.*?\\])",
71 "captures": {
72 "0": {
73 "name": "variable.name.source.dart"
74 }
75 }
76 },
77 {
78 "match": "^ {4,}(?![ \\*]).*",
79 "captures": {
80 "0": {
81 "name": "variable.name.source.dart"
82 }
83 }
84 },
85 {
86 "contentName": "variable.other.source.dart",
87 "begin": "```.*?$",
88 "end": "```"
89 },
90 {
91 "match": "(`.*?`)",
92 "captures": {
93 "0": {
94 "name": "variable.other.source.dart"
95 }
96 }
97 },
98 {
99 "match": "(`.*?`)",
100 "captures": {
101 "0": {
102 "name": "variable.other.source.dart"
103 }
104 }
105 },
106 {
107 "match": "(\\* (( ).*))$",
108 "captures": {
109 "2": {
110 "name": "variable.other.source.dart"
111 }
112 }
113 }
114 ]
115 },
116 "comments": {
117 "patterns": [
118 {
119 "name": "comment.block.empty.dart",
120 "match": "/\\*\\*/",
121 "captures": {
122 "0": {
123 "name": "punctuation.definition.comment.dart"
124 }
125 }
126 },
127 {
128 "include": "#comments-doc-oldschool"
129 },
130 {
131 "include": "#comments-doc"
132 },
133 {
134 "include": "#comments-inline"
135 }
136 ]
137 },
138 "comments-doc-oldschool": {
139 "patterns": [
140 {
141 "name": "comment.block.documentation.dart",
142 "begin": "/\\*\\*",
143 "end": "\\*/",
144 "patterns": [
145 {
146 "include": "#comments-doc-oldschool"
147 },
148 {
149 "include": "#comments-block"
150 },
151 {
152 "include": "#dartdoc"
153 }
154 ]
155 }
156 ]
157 },
158 "comments-doc": {
159 "patterns": [
160 {
161 "name": "comment.block.documentation.dart",
162 "begin": "///",
163 "while": "^\\s*///",
164 "patterns": [
165 {
166 "include": "#dartdoc"
167 }
168 ]
169 }
170 ]
171 },
172 "comments-inline": {
173 "patterns": [
174 {
175 "include": "#comments-block"
176 },
177 {
178 "match": "((//).*)$",
179 "captures": {
180 "1": {
181 "name": "comment.line.double-slash.dart"
182 }
183 }
184 }
185 ]
186 },
187 "comments-block": {
188 "patterns": [
189 {
190 "name": "comment.block.dart",
191 "begin": "/\\*",
192 "end": "\\*/",
193 "patterns": [
194 {
195 "include": "#comments-block"
196 }
197 ]
198 }
199 ]
200 },
201 "annotations": {
202 "patterns": [
203 {
204 "name": "storage.type.annotation.dart",
205 "match": "@[a-zA-Z]+"
206 }
207 ]
208 },
209 "constants-and-special-vars": {
210 "patterns": [
211 {
212 "name": "constant.language.dart",
213 "match": "(?<!\\$)\\b(true|false|null)\\b(?!\\$)"
214 },
215 {
216 "name": "variable.language.dart",
217 "match": "(?<!\\$)\\b(this|super)\\b(?!\\$)"
218 },
219 {
220 "name": "constant.numeric.dart",
221 "match": "(?<!\\$)\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b(?!\\$)"
222 },
223 {
224 "include": "#class-identifier"
225 },
226 {
227 "include": "#function-identifier"
228 }
229 ]
230 },
231 "class-identifier": {
232 "patterns": [
233 {
234 "match": "(?<!\\$)\\b(bool|num|int|double|dynamic)\\b(?!\\$)",
235 "name": "support.class.dart"
236 },
237 {
238 "match": "(?<!\\$)\\bvoid\\b(?!\\$)",
239 "name": "storage.type.primitive.dart"
240 },
241 {
242 "begin": "(?<![a-zA-Z0-9_$])([_$]*[A-Z][a-zA-Z0-9_$]*)\\b",
243 "end": "(?!<)",
244 "beginCaptures": {
245 "1": {
246 "name": "support.class.dart"
247 }
248 },
249 "patterns": [
250 {
251 "include": "#type-args"
252 }
253 ]
254 }
255 ]
256 },
257 "function-identifier": {
258 "patterns": [
259 {
260 "match": "([_$]*[a-z][a-zA-Z0-9_$]*)(<(?:[a-zA-Z0-9_$<>?]|,\\s*|\\s+extends\\s+)+>)?[!?]?\\(",
261 "captures": {
262 "1": {
263 "name": "entity.name.function.dart"
264 },
265 "2": {
266 "patterns": [
267 {
268 "include": "#type-args"
269 }
270 ]
271 }
272 }
273 }
274 ]
275 },
276 "type-args": {
277 "begin": "(<)",
278 "end": "(>)",
279 "beginCaptures": {
280 "1": {
281 "name": "other.source.dart"
282 }
283 },
284 "endCaptures": {
285 "1": {
286 "name": "other.source.dart"
287 }
288 },
289 "patterns": [
290 {
291 "include": "#class-identifier"
292 },
293 {
294 "match": ","
295 },
296 {
297 "name": "keyword.declaration.dart",
298 "match": "extends"
299 },
300 {
301 "include": "#comments"
302 }
303 ]
304 },
305 "keywords": {
306 "patterns": [
307 {
308 "name": "keyword.cast.dart",
309 "match": "(?<!\\$)\\bas\\b(?!\\$)"
310 },
311 {
312 "name": "keyword.control.catch-exception.dart",
313 "match": "(?<!\\$)\\b(try|on|catch|finally|throw|rethrow)\\b(?!\\$)"
314 },
315 {
316 "name": "keyword.control.dart",
317 "match": "(?<!\\$)\\b(break|case|continue|default|do|else|for|if|in|return|switch|while|when)\\b(?!\\$)"
318 },
319 {
320 "name": "keyword.control.dart",
321 "match": "(?<!\\$)\\b(sync(\\*)?|async(\\*)?|await|yield(\\*)?)\\b(?!\\$)"
322 },
323 {
324 "name": "keyword.control.dart",
325 "match": "(?<!\\$)\\bassert\\b(?!\\$)"
326 },
327 {
328 "name": "keyword.control.new.dart",
329 "match": "(?<!\\$)\\b(new)\\b(?!\\$)"
330 },
331 {
332 "name": "keyword.declaration.dart",
333 "match": "(?<!\\$)\\b(abstract|sealed|base|interface|inline class|class|enum|extends|extension|external|factory|implements|get(?!\\()|mixin|native|operator|set(?!\\()|typedef|with|covariant)\\b(?!\\$)"
334 },
335 {
336 "name": "storage.modifier.dart",
337 "match": "(?<!\\$)\\b(static|final|const|required|late)\\b(?!\\$)"
338 },
339 {
340 "name": "storage.type.primitive.dart",
341 "match": "(?<!\\$)\\b(?:void|var)\\b(?!\\$)"
342 }
343 ]
344 },
345 "operators": {
346 "patterns": [
347 {
348 "name": "keyword.operator.dart",
349 "match": "(?<!\\$)\\b(is\\!?)\\b(?!\\$)"
350 },
351 {
352 "name": "keyword.operator.ternary.dart",
353 "match": "\\?|:"
354 },
355 {
356 "name": "keyword.operator.bitwise.dart",
357 "match": "(<<|>>>?|~|\\^|\\||&)"
358 },
359 {
360 "name": "keyword.operator.assignment.bitwise.dart",
361 "match": "((&|\\^|\\||<<|>>>?)=)"
362 },
363 {
364 "name": "keyword.operator.closure.dart",
365 "match": "(=>)"
366 },
367 {
368 "name": "keyword.operator.comparison.dart",
369 "match": "(==|!=|<=?|>=?)"
370 },
371 {
372 "name": "keyword.operator.assignment.arithmetic.dart",
373 "match": "(([+*/%-]|\\~)=)"
374 },
375 {
376 "name": "keyword.operator.assignment.dart",
377 "match": "(=)"
378 },
379 {
380 "name": "keyword.operator.increment-decrement.dart",
381 "match": "(\\-\\-|\\+\\+)"
382 },
383 {
384 "name": "keyword.operator.arithmetic.dart",
385 "match": "(\\-|\\+|\\*|\\/|\\~\\/|%)"
386 },
387 {
388 "name": "keyword.operator.logical.dart",
389 "match": "(!|&&|\\|\\|)"
390 }
391 ]
392 },
393 "string-interp": {
394 "patterns": [
395 {
396 "match": "\\$([a-zA-Z0-9_]+)",
397 "captures": {
398 "1": {
399 "name": "variable.parameter.dart"
400 }
401 }
402 },
403 {
404 "name": "string.interpolated.expression.dart",
405 "begin": "\\$\\{",
406 "end": "\\}",
407 "patterns": [
408 {
409 "include": "#constants-and-special-vars",
410 "name": "variable.parameter.dart"
411 },
412 {
413 "include": "#strings"
414 },
415 {
416 "name": "variable.parameter.dart",
417 "match": "[a-zA-Z0-9_]+"
418 }
419 ]
420 },
421 {
422 "name": "constant.character.escape.dart",
423 "match": "\\\\."
424 }
425 ]
426 },
427 "strings": {
428 "patterns": [
429 {
430 "name": "string.interpolated.triple.double.dart",
431 "begin": "(?<!r)\"\"\"",
432 "end": "\"\"\"(?!\")",
433 "patterns": [
434 {
435 "include": "#string-interp"
436 }
437 ]
438 },
439 {
440 "name": "string.interpolated.triple.single.dart",
441 "begin": "(?<!r)'''",
442 "end": "'''(?!')",
443 "patterns": [
444 {
445 "include": "#string-interp"
446 }
447 ]
448 },
449 {
450 "name": "string.quoted.triple.double.dart",
451 "begin": "r\"\"\"",
452 "end": "\"\"\"(?!\")"
453 },
454 {
455 "name": "string.quoted.triple.single.dart",
456 "begin": "r'''",
457 "end": "'''(?!')"
458 },
459 {
460 "name": "string.interpolated.double.dart",
461 "begin": "(?<!\\|r)\"",
462 "end": "\"",
463 "patterns": [
464 {
465 "name": "invalid.string.newline",
466 "match": "\\n"
467 },
468 {
469 "include": "#string-interp"
470 }
471 ]
472 },
473 {
474 "name": "string.quoted.double.dart",
475 "begin": "r\"",
476 "end": "\"",
477 "patterns": [
478 {
479 "name": "invalid.string.newline",
480 "match": "\\n"
481 }
482 ]
483 },
484 {
485 "name": "string.interpolated.single.dart",
486 "begin": "(?<!\\|r)'",
487 "end": "'",
488 "patterns": [
489 {
490 "name": "invalid.string.newline",
491 "match": "\\n"
492 },
493 {
494 "include": "#string-interp"
495 }
496 ]
497 },
498 {
499 "name": "string.quoted.single.dart",
500 "begin": "r'",
501 "end": "'",
502 "patterns": [
503 {
504 "name": "invalid.string.newline",
505 "match": "\\n"
506 }
507 ]
508 }
509 ]
510 },
511 "punctuation": {
512 "patterns": [
513 {
514 "name": "punctuation.comma.dart",
515 "match": ","
516 },
517 {
518 "name": "punctuation.terminator.dart",
519 "match": ";"
520 },
521 {
522 "name": "punctuation.dot.dart",
523 "match": "\\."
524 }
525 ]
526 }
527 }
528 }
529