mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Merge #6361
6361: Textmate grammar: angle bracket fix (closes #6323) r=dustypomerleau a=dustypomerleau Fixes #6323 After tinkering, it became clear that `<` and `>` should really default to the punctuation interpretation in the vast majority of cases. In addition, the breakage is greater when an angle bracket is missed. So, rather than optimizing for a type parameter `meta` scope and considering every possible parent scope and child scope, the easier fix was to narrow the case where `<` and `>` are treated as comparison operators. Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
This commit is contained in:
commit
6d80dfaabb
1 changed files with 19 additions and 1 deletions
|
@ -641,10 +641,28 @@
|
|||
},
|
||||
{
|
||||
"comment": "less than, greater than (special case)",
|
||||
"match": "(^|\\s)(?<!=)([<>])\\s",
|
||||
"match": "(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.brackets.round.rust"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.brackets.square.rust"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.brackets.curly.rust"
|
||||
},
|
||||
"4": {
|
||||
"name": "keyword.operator.comparison.rust"
|
||||
},
|
||||
"5": {
|
||||
"name": "punctuation.brackets.round.rust"
|
||||
},
|
||||
"6": {
|
||||
"name": "punctuation.brackets.square.rust"
|
||||
},
|
||||
"7": {
|
||||
"name": "punctuation.brackets.curly.rust"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue