mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
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 <dustypomerleau@users.noreply.github.com>
This commit is contained in:
commit
f3fe6561c0
1 changed files with 1 additions and 1 deletions
|
@ -1127,7 +1127,7 @@
|
||||||
{
|
{
|
||||||
"comment": "variables",
|
"comment": "variables",
|
||||||
"name": "variable.other.rust",
|
"name": "variable.other.rust",
|
||||||
"match": "\\b(?<!\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b"
|
"match": "\\b(?<!(?<!\\.)\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue