提交 5bb9d0b0 编写于 作者: M Martin Aeschlimann

fixes #6611: [rust] The keyword `where` can't be highlighted like others

上级 de787e73
...@@ -138,6 +138,11 @@ ...@@ -138,6 +138,11 @@
"name": "support.type.core.rust", "name": "support.type.core.rust",
"match": "\\b(Drop|Fn|FnMut|FnOnce|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator)\\b" "match": "\\b(Drop|Fn|FnMut|FnOnce|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator)\\b"
}, },
"where": {
"comment": "Where clause",
"name": "keyword.other.rust",
"match": "\\bwhere\\b"
},
"std_types": { "std_types": {
"comment": "Standard library type", "comment": "Standard library type",
"name": "storage.class.std.rust", "name": "storage.class.std.rust",
...@@ -441,13 +446,16 @@ ...@@ -441,13 +446,16 @@
}, },
{ {
"include": "#const" "include": "#const"
},
{
"include": "#where"
} }
] ]
}, },
{ {
"comment": "Type declaration", "comment": "Type declaration",
"begin": "\\b(enum|struct|trait)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", "begin": "\\b(enum|struct|trait)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
"end": "[\\{;]", "end": "[\\{\\(;]",
"beginCaptures": { "beginCaptures": {
"1": { "1": {
"name": "storage.type.rust" "name": "storage.type.rust"
...@@ -477,6 +485,9 @@ ...@@ -477,6 +485,9 @@
}, },
{ {
"include": "#pub" "include": "#pub"
},
{
"include": "#where"
} }
] ]
}, },
...@@ -574,6 +585,9 @@ ...@@ -574,6 +585,9 @@
{ {
"name": "storage.type.rust", "name": "storage.type.rust",
"match": "\\bfor\\b" "match": "\\bfor\\b"
},
{
"include": "#where"
} }
] ]
} }
......
impl Foo<A,B>
where A: B
{ }
impl Foo<A,B> for C
where A: B
{ }
impl Foo<A,B> for C
{
fn foo<A,B> -> C
where A: B
{ }
}
fn foo<A,B> -> C
where A: B
{ }
struct Foo<A,B>
where A: B
{ }
trait Foo<A,B> : C
where A: B
{ }
\ No newline at end of file
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册