Skip to content

Commit 4e66fc5

Browse files
fix: distinguish turbofish function calls from namespaces
1 parent 07c7f35 commit 4e66fc5

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

editors/code/rust.tmGrammar.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,66 @@
544544
{
545545
"include": "#lvariables"
546546
},
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+
},
547562
{
548563
"include": "#namespaces"
549564
},
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+
},
550607
{
551608
"include": "#constants"
552609
},
@@ -562,6 +619,9 @@
562619
{
563620
"include": "#macros"
564621
},
622+
{
623+
"include": "#namespaces"
624+
},
565625
{
566626
"include": "#punctuation"
567627
},

0 commit comments

Comments
 (0)