diff --git a/RustEnhanced.sublime-syntax b/RustEnhanced.sublime-syntax index e81d4ad1..0bbb348f 100644 --- a/RustEnhanced.sublime-syntax +++ b/RustEnhanced.sublime-syntax @@ -1393,7 +1393,7 @@ contexts: - match: \b(crate|extern|use|where)\b scope: keyword.other.rust - - match: \b(else|for|if|loop|match|while|yield)\b + - match: \b(async|await|else|for|if|loop|match|try|while|yield)\b scope: keyword.control.rust - match: \b(break|continue)\b diff --git a/tests/syntax-rust/syntax_test_misc.rs b/tests/syntax-rust/syntax_test_misc.rs index 31588e59..1ba473f0 100644 --- a/tests/syntax-rust/syntax_test_misc.rs +++ b/tests/syntax-rust/syntax_test_misc.rs @@ -46,3 +46,13 @@ let override = 1; // ^^^^^^^^ invalid.illegal.rust let macro = 1; // ^^^^^ invalid.illegal.rust + +// async/await +let x = async {} +// ^^^^^ keyword.control.rust +let y = future.await; +// ^^^^^ keyword.control.rust + +// try keyword in 2018 edition +let x = try {} +// ^^^ keyword.control.rust