Skip to content

Commit f3fe656

Browse files
Merge #6491
6491: Textmate grammar: allow variables to terminate ranges r=dustypomerleau a=dustypomerleau Variables were originally designed not to match after a dot, in order to avoid matching struct field access, however this resulted in variables that end ranges not being highlighted. In order to fix this we match a preceding dot, only if it's preceded by at least one other dot. Attempting to match on `(\.{2,})?` won't work, because the optional group allows struct field access to match even when one dot is present. Co-authored-by: Dusty Pomerleau <[email protected]>
2 parents 1b14730 + 6959cb0 commit f3fe656

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

editors/code/rust.tmGrammar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@
11271127
{
11281128
"comment": "variables",
11291129
"name": "variable.other.rust",
1130-
"match": "\\b(?<!\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b"
1130+
"match": "\\b(?<!(?<!\\.)\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b"
11311131
}
11321132
]
11331133
}

0 commit comments

Comments
 (0)