PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.4.0
Code Block Pro – Beautiful Syntax Highlighting v1.4.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.4.0, at build/shiki/languages/dart.tmLanguage.json

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