diff --git a/CHANGELOG.md b/CHANGELOG.md index ac77a75ac5..54aa48d1b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ ## Syntaxes +- Highlight Rust `async` and `await` as keywords, see #3849 (@coyaSONG) - Add shebang-based detection for Tcl (`tclsh`, `wish`) and Expect (`expect`) scripts, see #3647 (@mvanhorn) - Change the URL of Zig submodule from GitHub to Codeberg, see #3519 (@sorairolake) - Don't color strings inside CSV files, to make it easier to tell which column they belong to, see #3521 (@keith-hall) diff --git a/assets/patches/Rust.sublime-syntax.patch b/assets/patches/Rust.sublime-syntax.patch index 3bd745e28f..6bac81cdf0 100644 --- a/assets/patches/Rust.sublime-syntax.patch +++ b/assets/patches/Rust.sublime-syntax.patch @@ -2,6 +2,9 @@ diff --git syntaxes/01_Packages/Rust/Rust.sublime-syntax syntaxes/01_Packages/Ru index 3c354486..24727a4e 100644 --- syntaxes/01_Packages/Rust/Rust.sublime-syntax +++ syntaxes/01_Packages/Rust/Rust.sublime-syntax +@@ -139 +139 @@ contexts: +- - match: \b(break|else|for|if|loop|match|while|continue)\b ++ - match: \b(async|await|break|else|for|if|loop|match|while|continue)\b @@ -907,6 +907,8 @@ contexts: - include: type-any-identifier - match: ':' diff --git a/tests/syntax-tests/highlighted/Rust/output.rs b/tests/syntax-tests/highlighted/Rust/output.rs index 14755cf6d0..7394989f41 100644 --- a/tests/syntax-tests/highlighted/Rust/output.rs +++ b/tests/syntax-tests/highlighted/Rust/output.rs @@ -159,3 +159,7 @@  }  } } + +async fn foo() { + async_foo().await.await.await; +} diff --git a/tests/syntax-tests/source/Rust/output.rs b/tests/syntax-tests/source/Rust/output.rs index e7d59d6707..027fca98a3 100644 --- a/tests/syntax-tests/source/Rust/output.rs +++ b/tests/syntax-tests/source/Rust/output.rs @@ -159,3 +159,7 @@ impl Drop for OutputType { } } } + +async fn foo() { + async_foo().await.await.await; +}