diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-26 10:28:48 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-26 10:28:48 +0000 |
commit | 6d80dfaabb00008062a16f7b9bf327c9fd4b72d1 (patch) | |
tree | 1787a2b36fafde4a7bddb8d515fad1c6885525cd /editors/code | |
parent | eae54b5f72baa1c1331720b0a46fe8aab01f186b (diff) | |
parent | efdcfcfb61a64fee410268bed6a10bf3af7c781f (diff) |
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 <[email protected]>
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/rust.tmGrammar.json | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index 450116df2..1b8cc713a 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json | |||
@@ -641,10 +641,28 @@ | |||
641 | }, | 641 | }, |
642 | { | 642 | { |
643 | "comment": "less than, greater than (special case)", | 643 | "comment": "less than, greater than (special case)", |
644 | "match": "(^|\\s)(?<!=)([<>])\\s", | 644 | "match": "(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))", |
645 | "captures": { | 645 | "captures": { |
646 | "1": { | ||
647 | "name": "punctuation.brackets.round.rust" | ||
648 | }, | ||
646 | "2": { | 649 | "2": { |
650 | "name": "punctuation.brackets.square.rust" | ||
651 | }, | ||
652 | "3": { | ||
653 | "name": "punctuation.brackets.curly.rust" | ||
654 | }, | ||
655 | "4": { | ||
647 | "name": "keyword.operator.comparison.rust" | 656 | "name": "keyword.operator.comparison.rust" |
657 | }, | ||
658 | "5": { | ||
659 | "name": "punctuation.brackets.round.rust" | ||
660 | }, | ||
661 | "6": { | ||
662 | "name": "punctuation.brackets.square.rust" | ||
663 | }, | ||
664 | "7": { | ||
665 | "name": "punctuation.brackets.curly.rust" | ||
648 | } | 666 | } |
649 | } | 667 | } |
650 | }, | 668 | }, |