|
104 | 104 | <dict>
|
105 | 105 | <key>patterns</key>
|
106 | 106 | <array>
|
| 107 | + <dict> |
| 108 | + <key>include</key> |
| 109 | + <string>#script-header</string> |
| 110 | + </dict> |
107 | 111 | <dict>
|
108 | 112 | <key>include</key>
|
109 | 113 | <string>#storage-modifiers</string>
|
|
124 | 128 | <key>include</key>
|
125 | 129 | <string>#comments</string>
|
126 | 130 | </dict>
|
127 |
| - <dict> |
128 |
| - <key>include</key> |
129 |
| - <string>#block-comments</string> |
130 |
| - </dict> |
131 | 131 | <dict>
|
132 | 132 | <key>include</key>
|
133 | 133 | <string>#strings</string>
|
|
152 | 152 | <key>include</key>
|
153 | 153 | <string>#scala-symbol</string>
|
154 | 154 | </dict>
|
| 155 | + <dict> |
| 156 | + <key>include</key> |
| 157 | + <string>#scala-quoted</string> |
| 158 | + </dict> |
| 159 | + <dict> |
| 160 | + <key>include</key> |
| 161 | + <string>#special-identifier</string> |
| 162 | + </dict> |
155 | 163 | <dict>
|
156 | 164 | <key>include</key>
|
157 | 165 | <string>#char-literal</string>
|
|
202 | 210 | </dict>
|
203 | 211 | <dict>
|
204 | 212 | <key>begin</key>
|
205 |
| - <string>^\s*(/\*\*)</string> |
| 213 | + <string>^\s*(/\*\*)(?!/)</string> |
206 | 214 | <key>beginCaptures</key>
|
207 | 215 | <dict>
|
208 | 216 | <key>1</key>
|
|
306 | 314 | <string>comment.block.scala</string>
|
307 | 315 | </dict>
|
308 | 316 | <dict>
|
309 |
| - <key>captures</key> |
| 317 | + <key>begin</key> |
| 318 | + <string>(^[ \t]+)?(?=//)</string> |
| 319 | + <key>beginCaptures</key> |
310 | 320 | <dict>
|
311 | 321 | <key>1</key>
|
312 | 322 | <dict>
|
313 | 323 | <key>name</key>
|
314 |
| - <string>comment.line.double-slash.scala</string> |
| 324 | + <string>punctuation.whitespace.comment.leading.scala</string> |
315 | 325 | </dict>
|
316 |
| - <key>2</key> |
| 326 | + </dict> |
| 327 | + <key>end</key> |
| 328 | + <string>(?!\G)</string> |
| 329 | + <key>patterns</key> |
| 330 | + <array> |
317 | 331 | <dict>
|
| 332 | + <key>begin</key> |
| 333 | + <string>//</string> |
| 334 | + <key>beginCaptures</key> |
| 335 | + <dict> |
| 336 | + <key>0</key> |
| 337 | + <dict> |
| 338 | + <key>name</key> |
| 339 | + <string>punctuation.definition.comment.scala</string> |
| 340 | + </dict> |
| 341 | + </dict> |
| 342 | + <key>end</key> |
| 343 | + <string>\n</string> |
318 | 344 | <key>name</key>
|
319 |
| - <string>punctuation.definition.comment.scala</string> |
| 345 | + <string>comment.line.double-slash.scala</string> |
320 | 346 | </dict>
|
321 |
| - </dict> |
322 |
| - <key>match</key> |
323 |
| - <string>\s*((//).*$)</string> |
| 347 | + </array> |
324 | 348 | </dict>
|
325 | 349 | </array>
|
326 | 350 | </dict>
|
|
336 | 360 | </dict>
|
337 | 361 | <dict>
|
338 | 362 | <key>match</key>
|
339 |
| - <string>\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b</string> |
| 363 | + <string>\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.[0-9]+)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?|[0-9]+)([LlFfDd]|UL|ul)?\b</string> |
340 | 364 | <key>name</key>
|
341 | 365 | <string>constant.numeric.scala</string>
|
342 | 366 | </dict>
|
|
381 | 405 | <key>match</key>
|
382 | 406 | <string>(?x)
|
383 | 407 | \b(def)\s+
|
384 |
| - (`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\s])(?=[(\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~><^+*%:!#|/@\\]+)</string> |
| 408 | + (`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\t .,;()\[\]{}'"`\w])(?=[(\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~><^+*%:!#|/@\\]+)</string> |
385 | 409 | </dict>
|
386 | 410 | <dict>
|
387 | 411 | <key>captures</key>
|
|
433 | 457 | <key>2</key>
|
434 | 458 | <dict>
|
435 | 459 | <key>name</key>
|
436 |
| - <string>keyword.declaration.volatile.scala</string> |
437 |
| - </dict> |
438 |
| - <key>3</key> |
439 |
| - <dict> |
440 |
| - <key>name</key> |
441 |
| - <string>entity.name.val.declaration</string> |
| 460 | + <string>constant.other.declaration.scala</string> |
442 | 461 | </dict>
|
443 | 462 | </dict>
|
444 | 463 | <key>match</key>
|
445 |
| - <string>\b(?:(val)|(var))\s+(?:(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\s])(?=[\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~><^+*%:!#|/@\\]+)|(?=\())</string> |
| 464 | + <string>\b(val)\s+(?:([A-Z][_a-zA-Z0-9]*))\b</string> |
446 | 465 | </dict>
|
447 | 466 | <dict>
|
448 | 467 | <key>captures</key>
|
449 | 468 | <dict>
|
450 | 469 | <key>1</key>
|
451 | 470 | <dict>
|
452 | 471 | <key>name</key>
|
453 |
| - <string>keyword.declaration.scala</string> |
| 472 | + <string>keyword.declaration.stable.scala</string> |
454 | 473 | </dict>
|
455 | 474 | <key>2</key>
|
456 | 475 | <dict>
|
457 | 476 | <key>name</key>
|
458 |
| - <string>entity.name.class.declaration</string> |
| 477 | + <string>keyword.declaration.volatile.scala</string> |
| 478 | + </dict> |
| 479 | + <key>3</key> |
| 480 | + <dict> |
| 481 | + <key>name</key> |
| 482 | + <string>variable.other.declaration.scala</string> |
459 | 483 | </dict>
|
460 | 484 | </dict>
|
461 | 485 | <key>match</key>
|
462 |
| - <string>\b(package object)\s+([^\s\{\(\[]+)</string> |
| 486 | + <string>\b(?:(val)|(var))\s+(?:(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\t .,;()\[\]{}'"`\w])(?=[\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~><^+*%:!#|/@\\]+)|(?=\())</string> |
463 | 487 | </dict>
|
464 | 488 | <dict>
|
465 | 489 | <key>captures</key>
|
|
472 | 496 | <key>2</key>
|
473 | 497 | <dict>
|
474 | 498 | <key>name</key>
|
475 |
| - <string>entity.name.package.scala</string> |
| 499 | + <string>keyword.declaration.scala</string> |
| 500 | + </dict> |
| 501 | + <key>3</key> |
| 502 | + <dict> |
| 503 | + <key>name</key> |
| 504 | + <string>entity.name.class.declaration</string> |
476 | 505 | </dict>
|
477 | 506 | </dict>
|
478 | 507 | <key>match</key>
|
479 |
| - <string>\b(package)\s+([\w\.]+)</string> |
| 508 | + <string>\b(package)\s+(object)\s+([^\s\{\(\[]+)</string> |
| 509 | + </dict> |
| 510 | + <dict> |
| 511 | + <key>begin</key> |
| 512 | + <string>\b(package)\s+</string> |
| 513 | + <key>beginCaptures</key> |
| 514 | + <dict> |
| 515 | + <key>1</key> |
| 516 | + <dict> |
| 517 | + <key>name</key> |
| 518 | + <string>keyword.other.import.scala</string> |
| 519 | + </dict> |
| 520 | + </dict> |
| 521 | + <key>end</key> |
| 522 | + <string>(?<=[\n;])</string> |
480 | 523 | <key>name</key>
|
481 | 524 | <string>meta.package.scala</string>
|
| 525 | + <key>patterns</key> |
| 526 | + <array> |
| 527 | + <dict> |
| 528 | + <key>include</key> |
| 529 | + <string>#comments</string> |
| 530 | + </dict> |
| 531 | + <dict> |
| 532 | + <key>match</key> |
| 533 | + <string>(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*)</string> |
| 534 | + <key>name</key> |
| 535 | + <string>entity.name.package.scala</string> |
| 536 | + </dict> |
| 537 | + <dict> |
| 538 | + <key>match</key> |
| 539 | + <string>\.</string> |
| 540 | + <key>name</key> |
| 541 | + <string>punctuation.definition.package</string> |
| 542 | + </dict> |
| 543 | + </array> |
482 | 544 | </dict>
|
483 | 545 | </array>
|
484 | 546 | </dict>
|
|
521 | 583 | </dict>
|
522 | 584 | <dict>
|
523 | 585 | <key>match</key>
|
524 |
| - <string>([^\s{;.]+)\s*\.\s*</string> |
| 586 | + <string>(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*)</string> |
525 | 587 | <key>name</key>
|
526 |
| - <string>variable.package.scala</string> |
| 588 | + <string>entity.name.import.scala</string> |
527 | 589 | </dict>
|
528 | 590 | <dict>
|
529 | 591 | <key>match</key>
|
530 |
| - <string>([^\s{;.]+)\s*</string> |
| 592 | + <string>\.</string> |
531 | 593 | <key>name</key>
|
532 |
| - <string>variable.import.scala</string> |
| 594 | + <string>punctuation.definition.import</string> |
533 | 595 | </dict>
|
534 | 596 | <dict>
|
535 | 597 | <key>begin</key>
|
|
562 | 624 | <key>1</key>
|
563 | 625 | <dict>
|
564 | 626 | <key>name</key>
|
565 |
| - <string>variable.import.renamed-from.scala</string> |
| 627 | + <string>entity.name.import.renamed-from.scala</string> |
566 | 628 | </dict>
|
567 | 629 | <key>2</key>
|
568 | 630 | <dict>
|
|
572 | 634 | <key>3</key>
|
573 | 635 | <dict>
|
574 | 636 | <key>name</key>
|
575 |
| - <string>variable.import.renamed-to.scala</string> |
| 637 | + <string>entity.name.import.renamed-to.scala</string> |
576 | 638 | </dict>
|
577 | 639 | </dict>
|
578 | 640 | <key>match</key>
|
579 | 641 | <string>(?x) \s*
|
580 |
| - ([^\s.,}]+) \s* |
581 |
| - (=>) \s* |
582 |
| - ([^\s.,}]+) \s* |
583 |
| - </string> |
| 642 | + (`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*) \s* |
| 643 | + (=>) \s* |
| 644 | + (`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*) \s* |
| 645 | + </string> |
584 | 646 | </dict>
|
585 | 647 | <dict>
|
586 | 648 | <key>match</key>
|
587 | 649 | <string>([^\s.,}]+)</string>
|
588 | 650 | <key>name</key>
|
589 |
| - <string>variable.import.scala</string> |
| 651 | + <string>entity.name.import.scala</string> |
590 | 652 | </dict>
|
591 | 653 | </array>
|
592 | 654 | </dict>
|
|
631 | 693 | </dict>
|
632 | 694 | </dict>
|
633 | 695 | <key>match</key>
|
634 |
| - <string>\b(new)\s+([^\s\{\(\[]+)</string> |
| 696 | + <string>\b(new)\s+([^\s,\{\}\(\)\[\]]+)</string> |
635 | 697 | </dict>
|
636 | 698 | <key>keywords</key>
|
637 | 699 | <dict>
|
|
702 | 764 | <string>For themes: Brackets look nice when colored.</string>
|
703 | 765 | <key>patterns</key>
|
704 | 766 | <array>
|
| 767 | + <dict> |
| 768 | + <key>comment</key> |
| 769 | + <string>The punctuation.section.*.begin is needed for return snippet in source bundle</string> |
| 770 | + <key>match</key> |
| 771 | + <string>\{</string> |
| 772 | + <key>name</key> |
| 773 | + <string>punctuation.section.block.begin.scala</string> |
| 774 | + </dict> |
| 775 | + <dict> |
| 776 | + <key>comment</key> |
| 777 | + <string>The punctuation.section.*.end is needed for return snippet in source bundle</string> |
| 778 | + <key>match</key> |
| 779 | + <string>\}</string> |
| 780 | + <key>name</key> |
| 781 | + <string>punctuation.section.block.end.scala</string> |
| 782 | + </dict> |
705 | 783 | <dict>
|
706 | 784 | <key>match</key>
|
707 | 785 | <string>{|}|\(|\)|\[|\]</string>
|
|
765 | 843 | <key>scala-symbol</key>
|
766 | 844 | <dict>
|
767 | 845 | <key>match</key>
|
768 |
| - <string>'\w+(?=[^'\w])</string> |
| 846 | + <string>'\w+(?=[^'\w]|$)</string> |
769 | 847 | <key>name</key>
|
770 |
| - <string>entity.name.symbol</string> |
| 848 | + <string>constant.other.symbol.scala</string> |
| 849 | + </dict> |
| 850 | + <key>scala-quoted</key> |
| 851 | + <dict> |
| 852 | + <key>match</key> |
| 853 | + <string>'\{'|'\('|'\['|'\{|'\(|'\[</string> |
| 854 | + <key>name</key> |
| 855 | + <string>constant.other.quoted.scala</string> |
| 856 | + </dict> |
| 857 | + <key>script-header</key> |
| 858 | + <dict> |
| 859 | + <key>captures</key> |
| 860 | + <dict> |
| 861 | + <key>1</key> |
| 862 | + <dict> |
| 863 | + <key>name</key> |
| 864 | + <string>string.unquoted.shebang.scala</string> |
| 865 | + </dict> |
| 866 | + </dict> |
| 867 | + <key>match</key> |
| 868 | + <string>^#!(.*)$</string> |
| 869 | + <key>name</key> |
| 870 | + <string>comment.block.shebang.scala</string> |
| 871 | + </dict> |
| 872 | + <key>special-identifier</key> |
| 873 | + <dict> |
| 874 | + <key>comment</key> |
| 875 | + <string> |
| 876 | + Match special scala style identifiers that can end with and underscore and |
| 877 | + a a not letter such as blank_?. This way the symbol will not be colored |
| 878 | + differently. |
| 879 | + </string> |
| 880 | + <key>match</key> |
| 881 | + <string>\b[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\t .,;()\[\]{}'"`\w])</string> |
771 | 882 | </dict>
|
772 | 883 | <key>storage-modifiers</key>
|
773 | 884 | <dict>
|
|
0 commit comments