diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index 450116df29..1b8cc713a7 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json @@ -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" } } },