PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.9.2
Code Block Pro – Beautiful Syntax Highlighting v1.9.2
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 / scala.tmLanguage.json

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

1,240 lines 38.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "fileTypes": ["scala"],
3 "firstLineMatch": "^#!/.*\\b\\w*scala\\b",
4 "foldingStartMarker": "/\\*\\*|\\{\\s*$",
5 "foldingStopMarker": "\\*\\*/|^\\s*\\}",
6 "keyEquivalent": "^~S",
7 "repository": {
8 "empty-parentheses": {
9 "match": "(\\(\\))",
10 "captures": {
11 "1": {
12 "name": "meta.bracket.scala"
13 }
14 },
15 "name": "meta.parentheses.scala"
16 },
17 "imports": {
18 "end": "(?<=[\\n;])",
19 "begin": "\\b(import)\\s+",
20 "beginCaptures": {
21 "1": {
22 "name": "keyword.other.import.scala"
23 }
24 },
25 "patterns": [
26 {
27 "include": "#comments"
28 },
29 {
30 "match": "\\b(given)\\b",
31 "name": "keyword.other.import.given.scala"
32 },
33 {
34 "match": "[A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?",
35 "name": "entity.name.class.import.scala"
36 },
37 {
38 "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))",
39 "name": "entity.name.import.scala"
40 },
41 {
42 "match": "\\.",
43 "name": "punctuation.definition.import"
44 },
45 {
46 "end": "}",
47 "begin": "{",
48 "beginCaptures": {
49 "0": {
50 "name": "meta.bracket.scala"
51 }
52 },
53 "patterns": [
54 {
55 "match": "(?x)(given\\s)?\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*(=>)\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*",
56 "captures": {
57 "1": {
58 "name": "keyword.other.import.given.scala"
59 },
60 "2": {
61 "name": "entity.name.class.import.renamed-from.scala"
62 },
63 "3": {
64 "name": "entity.name.import.renamed-from.scala"
65 },
66 "4": {
67 "name": "keyword.other.arrow.scala"
68 },
69 "5": {
70 "name": "entity.name.class.import.renamed-to.scala"
71 },
72 "6": {
73 "name": "entity.name.import.renamed-to.scala"
74 }
75 }
76 },
77 {
78 "match": "\\b(given)\\b",
79 "name": "keyword.other.import.given.scala"
80 },
81 {
82 "match": "(given\\s+)?(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))",
83 "captures": {
84 "1": {
85 "name": "keyword.other.import.given.scala"
86 },
87 "2": {
88 "name": "entity.name.class.import.scala"
89 },
90 "3": {
91 "name": "entity.name.import.scala"
92 }
93 }
94 }
95 ],
96 "endCaptures": {
97 "0": {
98 "name": "meta.bracket.scala"
99 }
100 },
101 "name": "meta.import.selector.scala"
102 }
103 ],
104 "name": "meta.import.scala"
105 },
106 "exports": {
107 "end": "(?<=[\\n;])",
108 "begin": "\\b(export)\\s+(given\\s+)?",
109 "beginCaptures": {
110 "1": {
111 "name": "keyword.other.export.scala"
112 },
113 "2": {
114 "name": "keyword.other.export.given.scala"
115 }
116 },
117 "patterns": [
118 {
119 "include": "#comments"
120 },
121 {
122 "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))",
123 "name": "entity.name.export.scala"
124 },
125 {
126 "match": "\\.",
127 "name": "punctuation.definition.export"
128 },
129 {
130 "end": "}",
131 "begin": "{",
132 "beginCaptures": {
133 "0": {
134 "name": "meta.bracket.scala"
135 }
136 },
137 "patterns": [
138 {
139 "match": "(?x)\\s*(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))\\s*(=>)\\s*(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))\\s*",
140 "captures": {
141 "1": {
142 "name": "entity.name.export.renamed-from.scala"
143 },
144 "2": {
145 "name": "keyword.other.arrow.scala"
146 },
147 "3": {
148 "name": "entity.name.export.renamed-to.scala"
149 }
150 }
151 },
152 {
153 "match": "([^\\s.,}]+)",
154 "name": "entity.name.export.scala"
155 }
156 ],
157 "endCaptures": {
158 "0": {
159 "name": "meta.bracket.scala"
160 }
161 },
162 "name": "meta.export.selector.scala"
163 }
164 ],
165 "name": "meta.export.scala"
166 },
167 "constants": {
168 "patterns": [
169 {
170 "match": "\\b(false|null|true)\\b",
171 "name": "constant.language.scala"
172 },
173 {
174 "match": "\\b(0[xX][0-9a-fA-F_]*)\\b",
175 "name": "constant.numeric.scala"
176 },
177 {
178 "match": "\\b(([0-9][0-9_]*(\\.[0-9][0-9_]*)?)([eE](\\+|-)?[0-9][0-9_]*)?|[0-9][0-9_]*)[LlFfDd]?\\b",
179 "name": "constant.numeric.scala"
180 },
181 {
182 "match": "(\\.[0-9][0-9_]*)([eE](\\+|-)?[0-9][0-9_]*)?[LlFfDd]?\\b",
183 "name": "constant.numeric.scala"
184 },
185 {
186 "match": "\\b(this|super)\\b",
187 "name": "variable.language.scala"
188 }
189 ]
190 },
191 "script-header": {
192 "match": "^#!(.*)$",
193 "captures": {
194 "1": {
195 "name": "string.unquoted.shebang.scala"
196 }
197 },
198 "name": "comment.block.shebang.scala"
199 },
200 "code": {
201 "patterns": [
202 {
203 "include": "#script-header"
204 },
205 {
206 "include": "#storage-modifiers"
207 },
208 {
209 "include": "#declarations"
210 },
211 {
212 "include": "#inheritance"
213 },
214 {
215 "include": "#extension"
216 },
217 {
218 "include": "#imports"
219 },
220 {
221 "include": "#exports"
222 },
223 {
224 "include": "#comments"
225 },
226 {
227 "include": "#strings"
228 },
229 {
230 "include": "#initialization"
231 },
232 {
233 "include": "#xml-literal"
234 },
235 {
236 "include": "#keywords"
237 },
238 {
239 "include": "#using"
240 },
241 {
242 "include": "#constants"
243 },
244 {
245 "include": "#scala-symbol"
246 },
247 {
248 "include": "#singleton-type"
249 },
250 {
251 "include": "#inline"
252 },
253 {
254 "include": "#scala-quoted"
255 },
256 {
257 "include": "#char-literal"
258 },
259 {
260 "include": "#empty-parentheses"
261 },
262 {
263 "include": "#parameter-list"
264 },
265 {
266 "include": "#qualifiedClassName"
267 },
268 {
269 "include": "#backQuotedVariable"
270 },
271 {
272 "include": "#curly-braces"
273 },
274 {
275 "include": "#meta-brackets"
276 },
277 {
278 "include": "#meta-bounds"
279 },
280 {
281 "include": "#meta-colons"
282 }
283 ]
284 },
285 "strings": {
286 "patterns": [
287 {
288 "end": "\"\"\"(?!\")",
289 "begin": "\"\"\"",
290 "beginCaptures": {
291 "0": {
292 "name": "punctuation.definition.string.begin.scala"
293 }
294 },
295 "patterns": [
296 {
297 "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}",
298 "name": "constant.character.escape.scala"
299 }
300 ],
301 "endCaptures": {
302 "0": {
303 "name": "punctuation.definition.string.end.scala"
304 }
305 },
306 "name": "string.quoted.triple.scala"
307 },
308 {
309 "begin": "\\b(raw)(\"\"\")",
310 "end": "(\"\"\")(?!\")|\\$\n|(\\$[^\\$\"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])",
311 "beginCaptures": {
312 "1": {
313 "name": "keyword.interpolation.scala"
314 },
315 "2": {
316 "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala"
317 }
318 },
319 "patterns": [
320 {
321 "match": "\\$[\\$\"]",
322 "name": "constant.character.escape.scala"
323 },
324 {
325 "include": "#string-interpolation"
326 },
327 {
328 "match": ".",
329 "name": "string.quoted.triple.interpolated.scala"
330 }
331 ],
332 "endCaptures": {
333 "1": {
334 "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala"
335 },
336 "2": {
337 "name": "invalid.illegal.unrecognized-string-escape.scala"
338 }
339 }
340 },
341 {
342 "begin": "\\b((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(\"\"\")",
343 "end": "(\"\"\")(?!\")|\\$\n|(\\$[^\\$\"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])",
344 "beginCaptures": {
345 "1": {
346 "name": "keyword.interpolation.scala"
347 },
348 "2": {
349 "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala"
350 }
351 },
352 "patterns": [
353 {
354 "include": "#string-interpolation"
355 },
356 {
357 "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}",
358 "name": "constant.character.escape.scala"
359 },
360 {
361 "match": ".",
362 "name": "string.quoted.triple.interpolated.scala"
363 }
364 ],
365 "endCaptures": {
366 "1": {
367 "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala"
368 },
369 "2": {
370 "name": "invalid.illegal.unrecognized-string-escape.scala"
371 }
372 }
373 },
374 {
375 "end": "\"",
376 "begin": "\"",
377 "beginCaptures": {
378 "0": {
379 "name": "punctuation.definition.string.begin.scala"
380 }
381 },
382 "patterns": [
383 {
384 "match": "\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})",
385 "name": "constant.character.escape.scala"
386 },
387 {
388 "match": "\\\\.",
389 "name": "invalid.illegal.unrecognized-string-escape.scala"
390 }
391 ],
392 "endCaptures": {
393 "0": {
394 "name": "punctuation.definition.string.end.scala"
395 }
396 },
397 "name": "string.quoted.double.scala"
398 },
399 {
400 "begin": "\\b(raw)(\")",
401 "end": "(\")|\\$\n|(\\$[^\\$\"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])",
402 "beginCaptures": {
403 "1": {
404 "name": "keyword.interpolation.scala"
405 },
406 "2": {
407 "name": "string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala"
408 }
409 },
410 "patterns": [
411 {
412 "match": "\\$[\\$\"]",
413 "name": "constant.character.escape.scala"
414 },
415 {
416 "include": "#string-interpolation"
417 },
418 {
419 "match": ".",
420 "name": "string.quoted.double.interpolated.scala"
421 }
422 ],
423 "endCaptures": {
424 "1": {
425 "name": "string.quoted.double.interpolated.scala punctuation.definition.string.end.scala"
426 },
427 "2": {
428 "name": "invalid.illegal.unrecognized-string-escape.scala"
429 }
430 }
431 },
432 {
433 "begin": "\\b((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(\")",
434 "end": "(\")|\\$\n|(\\$[^\\$\"_{A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}])",
435 "beginCaptures": {
436 "1": {
437 "name": "keyword.interpolation.scala"
438 },
439 "2": {
440 "name": "string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala"
441 }
442 },
443 "patterns": [
444 {
445 "match": "\\$[\\$\"]",
446 "name": "constant.character.escape.scala"
447 },
448 {
449 "include": "#string-interpolation"
450 },
451 {
452 "match": "\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})",
453 "name": "constant.character.escape.scala"
454 },
455 {
456 "match": "\\\\.",
457 "name": "invalid.illegal.unrecognized-string-escape.scala"
458 },
459 {
460 "match": ".",
461 "name": "string.quoted.double.interpolated.scala"
462 }
463 ],
464 "endCaptures": {
465 "1": {
466 "name": "string.quoted.double.interpolated.scala punctuation.definition.string.end.scala"
467 },
468 "2": {
469 "name": "invalid.illegal.unrecognized-string-escape.scala"
470 }
471 }
472 }
473 ]
474 },
475 "using": {
476 "patterns": [
477 {
478 "match": "(?<=\\()\\s*(using)\\s",
479 "captures": {
480 "1": {
481 "name": "keyword.declaration.scala"
482 }
483 }
484 }
485 ]
486 },
487 "string-interpolation": {
488 "patterns": [
489 {
490 "name": "constant.character.escape.interpolation.scala",
491 "match": "\\$\\$"
492 },
493 {
494 "name": "meta.template.expression.scala",
495 "match": "(\\$)([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\p{Lo}\\p{Nl}\\p{Ll}0-9]*)",
496 "captures": {
497 "1": {
498 "name": "punctuation.definition.template-expression.begin.scala"
499 }
500 }
501 },
502 {
503 "name": "meta.template.expression.scala",
504 "begin": "\\$\\{",
505 "beginCaptures": {
506 "0": {
507 "name": "punctuation.definition.template-expression.begin.scala"
508 }
509 },
510 "end": "\\}",
511 "endCaptures": {
512 "0": {
513 "name": "punctuation.definition.template-expression.end.scala"
514 }
515 },
516 "patterns": [
517 {
518 "include": "#code"
519 }
520 ],
521 "contentName": "meta.embedded.line.scala"
522 }
523 ]
524 },
525 "xml-entity": {
526 "match": "(&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)",
527 "captures": {
528 "1": {
529 "name": "punctuation.definition.constant.xml"
530 },
531 "3": {
532 "name": "punctuation.definition.constant.xml"
533 }
534 },
535 "name": "constant.character.entity.xml"
536 },
537 "xml-singlequotedString": {
538 "end": "'",
539 "begin": "'",
540 "beginCaptures": {
541 "0": {
542 "name": "punctuation.definition.string.begin.xml"
543 }
544 },
545 "patterns": [
546 {
547 "include": "#xml-entity"
548 }
549 ],
550 "endCaptures": {
551 "0": {
552 "name": "punctuation.definition.string.end.xml"
553 }
554 },
555 "name": "string.quoted.single.xml"
556 },
557 "meta-colons": {
558 "patterns": [
559 {
560 "match": "(?<!:):(?!:)",
561 "name": "meta.colon.scala"
562 }
563 ],
564 "comment": "For themes: Matching type colons"
565 },
566 "keywords": {
567 "patterns": [
568 {
569 "match": "\\b(return|throw)\\b",
570 "name": "keyword.control.flow.jump.scala"
571 },
572 {
573 "match": "\\b(classOf|isInstanceOf|asInstanceOf)\\b",
574 "name": "support.function.type-of.scala"
575 },
576 {
577 "match": "\\b(else|if|then|do|while|for|yield|match|case)\\b",
578 "name": "keyword.control.flow.scala"
579 },
580 {
581 "match": "^\\s*(end)\\s+(if|while|for|match)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)",
582 "name": "keyword.control.flow.end.scala"
583 },
584 {
585 "match": "^\\s*(end)\\s+(val)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)",
586 "name": "keyword.declaration.stable.end.scala"
587 },
588 {
589 "match": "^\\s*(end)\\s+(var)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)",
590 "name": "keyword.declaration.volatile.end.scala"
591 },
592 {
593 "match": "^\\s*(end)\\s+(?:(new|extension)|([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?))(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)",
594 "captures": {
595 "1": {
596 "name": "keyword.declaration.end.scala"
597 },
598 "2": {
599 "name": "keyword.declaration.end.scala"
600 },
601 "3": {
602 "name": "entity.name.type.declaration"
603 }
604 }
605 },
606 {
607 "match": "\\b(catch|finally|try)\\b",
608 "name": "keyword.control.exception.scala"
609 },
610 {
611 "match": "^\\s*(end)\\s+(try)(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)",
612 "name": "keyword.control.exception.end.scala"
613 },
614 {
615 "match": "^\\s*(end)\\s+(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))?(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)",
616 "captures": {
617 "1": {
618 "name": "keyword.declaration.end.scala"
619 },
620 "2": {
621 "name": "entity.name.declaration"
622 }
623 }
624 },
625 {
626 "match": "(==?|!=|<=|>=|<>|<|>)",
627 "name": "keyword.operator.comparison.scala"
628 },
629 {
630 "match": "(\\-|\\+|\\*|/(?![/*])|%|~)",
631 "name": "keyword.operator.arithmetic.scala"
632 },
633 {
634 "match": "(?<![!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]|_)(!|&&|\\|\\|)(?![!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}])",
635 "name": "keyword.operator.logical.scala"
636 },
637 {
638 "match": "(<-|←|->|→|=>|⇒|\\?|\\:+|@|\\|)+",
639 "name": "keyword.operator.scala"
640 }
641 ]
642 },
643 "singleton-type": {
644 "match": "\\.(type)(?![A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[0-9])",
645 "captures": {
646 "1": {
647 "name": "keyword.type.scala"
648 }
649 }
650 },
651 "inline": {
652 "patterns": [
653 {
654 "match": "\\b(inline)(?=\\s+((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)\\s*:)",
655 "name": "storage.modifier.other"
656 },
657 {
658 "match": "\\b(inline)\\b(?=(?:.(?!\\b(?:val|def|given)\\b))*\\b(if|match)\\b)",
659 "name": "keyword.control.flow.scala"
660 }
661 ]
662 },
663 "scala-quoted": {
664 "patterns": [
665 {
666 "match": "['$]\\{(?!')",
667 "name": "punctuation.section.block.begin.scala"
668 },
669 {
670 "match": "'\\[(?!')",
671 "name": "meta.bracket.scala"
672 }
673 ]
674 },
675 "xml-doublequotedString": {
676 "end": "\"",
677 "begin": "\"",
678 "beginCaptures": {
679 "0": {
680 "name": "punctuation.definition.string.begin.xml"
681 }
682 },
683 "patterns": [
684 {
685 "include": "#xml-entity"
686 }
687 ],
688 "endCaptures": {
689 "0": {
690 "name": "punctuation.definition.string.end.xml"
691 }
692 },
693 "name": "string.quoted.double.xml"
694 },
695 "declarations": {
696 "patterns": [
697 {
698 "match": "\\b(def)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?",
699 "captures": {
700 "1": {
701 "name": "keyword.declaration.scala"
702 },
703 "2": {
704 "name": "entity.name.function.declaration"
705 }
706 }
707 },
708 {
709 "match": "\\b(trait)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?",
710 "captures": {
711 "1": {
712 "name": "keyword.declaration.scala"
713 },
714 "2": {
715 "name": "entity.name.class.declaration"
716 }
717 }
718 },
719 {
720 "match": "\\b(?:(case)\\s+)?(class|object|enum)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?",
721 "captures": {
722 "1": {
723 "name": "keyword.declaration.scala"
724 },
725 "2": {
726 "name": "keyword.declaration.scala"
727 },
728 "3": {
729 "name": "entity.name.class.declaration"
730 }
731 }
732 },
733 {
734 "match": "(?<!\\.)\\b(type)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?",
735 "captures": {
736 "1": {
737 "name": "keyword.declaration.scala"
738 },
739 "2": {
740 "name": "entity.name.type.declaration"
741 }
742 }
743 },
744 {
745 "match": "\\b(?:(val)|(var))\\b\\s*(?!//|/\\*)(?=(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)?\\()",
746 "captures": {
747 "1": {
748 "name": "keyword.declaration.stable.scala"
749 },
750 "2": {
751 "name": "keyword.declaration.volatile.scala"
752 }
753 }
754 },
755 {
756 "match": "\\b(?:(val)|(var))\\b\\s*(?!//|/\\*)(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)(?=\\s*,)",
757 "captures": {
758 "1": {
759 "name": "keyword.declaration.stable.scala"
760 },
761 "2": {
762 "name": "keyword.declaration.volatile.scala"
763 }
764 }
765 },
766 {
767 "match": "\\b(?:(val)|(var))\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?",
768 "captures": {
769 "1": {
770 "name": "keyword.declaration.stable.scala"
771 },
772 "2": {
773 "name": "keyword.declaration.volatile.scala"
774 },
775 "3": {
776 "name": "variable.other.declaration.scala"
777 }
778 }
779 },
780 {
781 "match": "\\b(package)\\s+(object)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?",
782 "captures": {
783 "1": {
784 "name": "keyword.other.scoping.scala"
785 },
786 "2": {
787 "name": "keyword.declaration.scala"
788 },
789 "3": {
790 "name": "entity.name.class.declaration"
791 }
792 }
793 },
794 {
795 "end": "(?<=[\\n;])",
796 "begin": "\\b(package)\\s+",
797 "beginCaptures": {
798 "1": {
799 "name": "keyword.other.import.scala"
800 }
801 },
802 "patterns": [
803 {
804 "include": "#comments"
805 },
806 {
807 "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))",
808 "name": "entity.name.package.scala"
809 },
810 {
811 "match": "\\.",
812 "name": "punctuation.definition.package"
813 }
814 ],
815 "name": "meta.package.scala"
816 },
817 {
818 "match": "\\b(given)\\b\\s*([_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`)?",
819 "captures": {
820 "1": {
821 "name": "keyword.declaration.scala"
822 },
823 "2": {
824 "name": "entity.name.given.declaration"
825 }
826 }
827 }
828 ]
829 },
830 "char-literal": {
831 "end": "'|$",
832 "begin": "'",
833 "beginCaptures": {
834 "0": {
835 "name": "punctuation.definition.character.begin.scala"
836 }
837 },
838 "patterns": [
839 {
840 "match": "\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})",
841 "name": "constant.character.escape.scala"
842 },
843 {
844 "match": "\\\\.",
845 "name": "invalid.illegal.unrecognized-character-escape.scala"
846 },
847 {
848 "match": "[^']{2,}",
849 "name": "invalid.illegal.character-literal-too-long"
850 },
851 {
852 "match": "(?<!')[^']",
853 "name": "invalid.illegal.character-literal-too-long"
854 }
855 ],
856 "endCaptures": {
857 "0": {
858 "name": "punctuation.definition.character.end.scala"
859 }
860 },
861 "name": "string.quoted.other constant.character.literal.scala"
862 },
863 "initialization": {
864 "match": "\\b(new)\\b",
865 "captures": {
866 "1": {
867 "name": "keyword.declaration.scala"
868 }
869 }
870 },
871 "scala-symbol": {
872 "match": "(?>'(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))(?!')",
873 "name": "constant.other.symbol.scala"
874 },
875 "curly-braces": {
876 "begin": "\\{",
877 "end": "\\}",
878 "beginCaptures": {
879 "0": {
880 "name": "punctuation.section.block.begin.scala"
881 }
882 },
883 "endCaptures": {
884 "0": {
885 "name": "punctuation.section.block.end.scala"
886 }
887 },
888 "patterns": [
889 {
890 "include": "#code"
891 }
892 ]
893 },
894 "meta-brackets": {
895 "patterns": [
896 {
897 "match": "\\{",
898 "comment": "The punctuation.section.*.begin is needed for return snippet in source bundle",
899 "name": "punctuation.section.block.begin.scala"
900 },
901 {
902 "match": "\\}",
903 "comment": "The punctuation.section.*.end is needed for return snippet in source bundle",
904 "name": "punctuation.section.block.end.scala"
905 },
906 {
907 "match": "{|}|\\(|\\)|\\[|\\]",
908 "name": "meta.bracket.scala"
909 }
910 ],
911 "comment": "For themes: Brackets look nice when colored."
912 },
913 "qualifiedClassName": {
914 "match": "(\\b([A-Z][\\w]*)(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)",
915 "captures": {
916 "1": {
917 "name": "entity.name.class"
918 }
919 }
920 },
921 "backQuotedVariable": {
922 "match": "`[^`]+`"
923 },
924 "storage-modifiers": {
925 "patterns": [
926 {
927 "match": "\\b(private\\[\\S+\\]|protected\\[\\S+\\]|private|protected)\\b",
928 "name": "storage.modifier.access"
929 },
930 {
931 "match": "\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|override|@transient|@native)\\b",
932 "name": "storage.modifier.other"
933 },
934 {
935 "match": "(?<=^|\\s)\\b(transparent|opaque|infix|open|inline)\\b(?=[a-z\\s]*\\b(def|val|var|given|type|class|trait|object|enum)\\b)",
936 "name": "storage.modifier.other"
937 }
938 ]
939 },
940 "meta-bounds": {
941 "match": "<%|=:=|<:<|<%<|>:|<:",
942 "comment": "For themes: Matching view bounds",
943 "name": "meta.bounds.scala"
944 },
945 "comments": {
946 "patterns": [
947 {
948 "include": "#block-comments"
949 },
950 {
951 "end": "(?!\\G)",
952 "begin": "(^[ \\t]+)?(?=//)",
953 "beginCaptures": {
954 "1": {
955 "name": "punctuation.whitespace.comment.leading.scala"
956 }
957 },
958 "patterns": [
959 {
960 "end": "\\n",
961 "begin": "//",
962 "beginCaptures": {
963 "0": {
964 "name": "punctuation.definition.comment.scala"
965 }
966 },
967 "name": "comment.line.double-slash.scala"
968 }
969 ]
970 }
971 ]
972 },
973 "block-comments": {
974 "patterns": [
975 {
976 "match": "/\\*\\*/",
977 "captures": {
978 "0": {
979 "name": "punctuation.definition.comment.scala"
980 }
981 },
982 "name": "comment.block.empty.scala"
983 },
984 {
985 "end": "\\*/",
986 "begin": "^\\s*(/\\*\\*)(?!/)",
987 "beginCaptures": {
988 "1": {
989 "name": "punctuation.definition.comment.scala"
990 }
991 },
992 "patterns": [
993 {
994 "match": "(@param)\\s+(\\S+)",
995 "captures": {
996 "1": {
997 "name": "keyword.other.documentation.scaladoc.scala"
998 },
999 "2": {
1000 "name": "variable.parameter.scala"
1001 }
1002 }
1003 },
1004 {
1005 "match": "(@(?:tparam|throws))\\s+(\\S+)",
1006 "captures": {
1007 "1": {
1008 "name": "keyword.other.documentation.scaladoc.scala"
1009 },
1010 "2": {
1011 "name": "entity.name.class"
1012 }
1013 }
1014 },
1015 {
1016 "match": "@(return|see|note|example|constructor|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\\b",
1017 "name": "keyword.other.documentation.scaladoc.scala"
1018 },
1019 {
1020 "match": "(\\[\\[)([^\\]]+)(\\]\\])",
1021 "captures": {
1022 "1": {
1023 "name": "punctuation.definition.documentation.link.scala"
1024 },
1025 "2": {
1026 "name": "string.other.link.title.markdown"
1027 },
1028 "3": {
1029 "name": "punctuation.definition.documentation.link.scala"
1030 }
1031 }
1032 },
1033 {
1034 "include": "#block-comments"
1035 }
1036 ],
1037 "endCaptures": {
1038 "0": {
1039 "name": "punctuation.definition.comment.scala"
1040 }
1041 },
1042 "name": "comment.block.documentation.scala"
1043 },
1044 {
1045 "end": "\\*/",
1046 "begin": "/\\*",
1047 "captures": {
1048 "0": {
1049 "name": "punctuation.definition.comment.scala"
1050 }
1051 },
1052 "patterns": [
1053 {
1054 "include": "#block-comments"
1055 }
1056 ],
1057 "name": "comment.block.scala"
1058 }
1059 ]
1060 },
1061 "xml-embedded-content": {
1062 "patterns": [
1063 {
1064 "end": "}",
1065 "begin": "{",
1066 "patterns": [
1067 {
1068 "include": "#code"
1069 }
1070 ],
1071 "captures": {
1072 "0": {
1073 "name": "meta.bracket.scala"
1074 }
1075 },
1076 "name": "meta.source.embedded.scala"
1077 },
1078 {
1079 "match": " (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)=",
1080 "captures": {
1081 "1": {
1082 "name": "entity.other.attribute-name.namespace.xml"
1083 },
1084 "2": {
1085 "name": "entity.other.attribute-name.xml"
1086 },
1087 "3": {
1088 "name": "punctuation.separator.namespace.xml"
1089 },
1090 "4": {
1091 "name": "entity.other.attribute-name.localname.xml"
1092 }
1093 }
1094 },
1095 {
1096 "include": "#xml-doublequotedString"
1097 },
1098 {
1099 "include": "#xml-singlequotedString"
1100 }
1101 ]
1102 },
1103 "inheritance": {
1104 "patterns": [
1105 {
1106 "match": "\\b(extends|with|derives)\\b\\s*([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`|(?=\\([^\\)]+=>)|(?=(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))|(?=\"))?",
1107 "captures": {
1108 "1": {
1109 "name": "keyword.declaration.scala"
1110 },
1111 "2": {
1112 "name": "entity.other.inherited-class.scala"
1113 }
1114 }
1115 }
1116 ]
1117 },
1118 "extension": {
1119 "patterns": [
1120 {
1121 "match": "^\\s*(extension)\\s+(?=[\\[\\(])",
1122 "captures": {
1123 "1": {
1124 "name": "keyword.declaration.scala"
1125 }
1126 }
1127 }
1128 ]
1129 },
1130 "parameter-list": {
1131 "patterns": [
1132 {
1133 "match": "(?<=[^\\._$a-zA-Z0-9])(`[^`]+`|[_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)\\s*(:)\\s+",
1134 "captures": {
1135 "1": {
1136 "name": "variable.parameter.scala"
1137 },
1138 "2": {
1139 "name": "meta.colon.scala"
1140 }
1141 }
1142 }
1143 ]
1144 },
1145 "xml-literal": {
1146 "patterns": [
1147 {
1148 "end": "(>(<))/(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]*[_a-zA-Z0-9])(>)",
1149 "begin": "(<)((?:([_a-zA-Z0-9][_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*))(?=(\\s[^>]*)?></\\2>)",
1150 "beginCaptures": {
1151 "1": {
1152 "name": "punctuation.definition.tag.xml"
1153 },
1154 "3": {
1155 "name": "entity.name.tag.namespace.xml"
1156 },
1157 "4": {
1158 "name": "entity.name.tag.xml"
1159 },
1160 "5": {
1161 "name": "punctuation.separator.namespace.xml"
1162 },
1163 "6": {
1164 "name": "entity.name.tag.localname.xml"
1165 }
1166 },
1167 "patterns": [
1168 {
1169 "include": "#xml-embedded-content"
1170 }
1171 ],
1172 "comment": "We do not allow a tag name to start with a - since this would likely conflict with the <- operator. This is not very common for tag names anyway. Also code such as -- if (val <val2 || val> val3) will falsly be recognized as an xml tag. The solution is to put a space on either side of the comparison operator",
1173 "endCaptures": {
1174 "1": {
1175 "name": "punctuation.definition.tag.xml"
1176 },
1177 "2": {
1178 "name": "meta.scope.between-tag-pair.xml"
1179 },
1180 "3": {
1181 "name": "entity.name.tag.namespace.xml"
1182 },
1183 "4": {
1184 "name": "entity.name.tag.xml"
1185 },
1186 "5": {
1187 "name": "punctuation.separator.namespace.xml"
1188 },
1189 "6": {
1190 "name": "entity.name.tag.localname.xml"
1191 },
1192 "7": {
1193 "name": "punctuation.definition.tag.xml"
1194 }
1195 },
1196 "name": "meta.tag.no-content.xml"
1197 },
1198 {
1199 "end": "(/?>)",
1200 "begin": "(</?)(?:([_a-zA-Z0-9][-_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*)(?=[^>]*?>)",
1201 "patterns": [
1202 {
1203 "include": "#xml-embedded-content"
1204 }
1205 ],
1206 "captures": {
1207 "1": {
1208 "name": "punctuation.definition.tag.xml"
1209 },
1210 "2": {
1211 "name": "entity.name.tag.namespace.xml"
1212 },
1213 "3": {
1214 "name": "entity.name.tag.xml"
1215 },
1216 "4": {
1217 "name": "punctuation.separator.namespace.xml"
1218 },
1219 "5": {
1220 "name": "entity.name.tag.localname.xml"
1221 }
1222 },
1223 "name": "meta.tag.xml"
1224 },
1225 {
1226 "include": "#xml-entity"
1227 }
1228 ]
1229 }
1230 },
1231 "uuid": "158C0929-299A-40C8-8D89-316BE0C446E8",
1232 "patterns": [
1233 {
1234 "include": "#code"
1235 }
1236 ],
1237 "name": "scala",
1238 "scopeName": "source.scala"
1239 }
1240