aboutsummaryrefslogtreecommitdiff
path: root/editors/code/rust.tmGrammar.json
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/rust.tmGrammar.json')
-rw-r--r--editors/code/rust.tmGrammar.json88
1 files changed, 86 insertions, 2 deletions
diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json
index 450116df2..77595aa00 100644
--- a/editors/code/rust.tmGrammar.json
+++ b/editors/code/rust.tmGrammar.json
@@ -140,6 +140,12 @@
140 }, 140 },
141 "patterns": [ 141 "patterns": [
142 { 142 {
143 "include": "#block-comments"
144 },
145 {
146 "include": "#comments"
147 },
148 {
143 "include": "#keywords" 149 "include": "#keywords"
144 }, 150 },
145 { 151 {
@@ -456,7 +462,7 @@
456 "name": "punctuation.brackets.angle.rust" 462 "name": "punctuation.brackets.angle.rust"
457 } 463 }
458 }, 464 },
459 "end": "\\{", 465 "end": "\\{|;",
460 "endCaptures": { 466 "endCaptures": {
461 "0": { 467 "0": {
462 "name": "punctuation.brackets.curly.rust" 468 "name": "punctuation.brackets.curly.rust"
@@ -539,9 +545,66 @@
539 "include": "#lvariables" 545 "include": "#lvariables"
540 }, 546 },
541 { 547 {
548 "include": "#constants"
549 },
550 {
551 "include": "#gtypes"
552 },
553 {
554 "include": "#functions"
555 },
556 {
557 "include": "#lifetimes"
558 },
559 {
560 "include": "#macros"
561 },
562 {
542 "include": "#namespaces" 563 "include": "#namespaces"
543 }, 564 },
544 { 565 {
566 "include": "#punctuation"
567 },
568 {
569 "include": "#strings"
570 },
571 {
572 "include": "#types"
573 },
574 {
575 "include": "#variables"
576 }
577 ]
578 },
579 {
580 "comment": "function/method calls with turbofish",
581 "name": "meta.function.call.rust",
582 "begin": "((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(?=::<.*>\\()",
583 "beginCaptures": {
584 "1": {
585 "name": "entity.name.function.rust"
586 }
587 },
588 "end": "\\)",
589 "endCaptures": {
590 "0": {
591 "name": "punctuation.brackets.round.rust"
592 }
593 },
594 "patterns": [
595 {
596 "include": "#block-comments"
597 },
598 {
599 "include": "#comments"
600 },
601 {
602 "include": "#keywords"
603 },
604 {
605 "include": "#lvariables"
606 },
607 {
545 "include": "#constants" 608 "include": "#constants"
546 }, 609 },
547 { 610 {
@@ -557,6 +620,9 @@
557 "include": "#macros" 620 "include": "#macros"
558 }, 621 },
559 { 622 {
623 "include": "#namespaces"
624 },
625 {
560 "include": "#punctuation" 626 "include": "#punctuation"
561 }, 627 },
562 { 628 {
@@ -641,10 +707,28 @@
641 }, 707 },
642 { 708 {
643 "comment": "less than, greater than (special case)", 709 "comment": "less than, greater than (special case)",
644 "match": "(^|\\s)(?<!=)([<>])\\s", 710 "match": "(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))",
645 "captures": { 711 "captures": {
712 "1": {
713 "name": "punctuation.brackets.round.rust"
714 },
646 "2": { 715 "2": {
716 "name": "punctuation.brackets.square.rust"
717 },
718 "3": {
719 "name": "punctuation.brackets.curly.rust"
720 },
721 "4": {
647 "name": "keyword.operator.comparison.rust" 722 "name": "keyword.operator.comparison.rust"
723 },
724 "5": {
725 "name": "punctuation.brackets.round.rust"
726 },
727 "6": {
728 "name": "punctuation.brackets.square.rust"
729 },
730 "7": {
731 "name": "punctuation.brackets.curly.rust"
648 } 732 }
649 } 733 }
650 }, 734 },