diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs
index bea5065445ec..baed8e2170fb 100644
--- a/crates/ide/src/syntax_highlighting/highlight.rs
+++ b/crates/ide/src/syntax_highlighting/highlight.rs
@@ -227,8 +227,8 @@ pub(super) fn element(
k if k.is_keyword() => {
let h = Highlight::new(HlTag::Keyword);
match k {
- T![await]
- | T![break]
+ T![await] => h | HlMod::Async | HlMod::ControlFlow,
+ T![break]
| T![continue]
| T![else]
| T![if]
@@ -255,7 +255,7 @@ pub(super) fn element(
})
.map(|modifier| h | modifier)
.unwrap_or(h),
- T![async] | T![await] => h | HlMod::Async,
+ T![async] => h | HlMod::Async,
_ => h,
}
}
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html
index df419219494a..33bc6b0f3b0a 100644
--- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html
+++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html
@@ -234,4 +234,15 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
Nope => Nope,
}
}
+}
+
+async fn learn_and_sing() {
+ let song = learn_song().await;
+ sing_song(song).await;
+}
+
+async fn async_main() {
+ let f1 = learn_and_sing();
+ let f2 = dance();
+ futures::join!(f1, f2);
}
\ No newline at end of file
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index b6e952b08882..32f2d9038ea3 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -208,6 +208,17 @@ impl Option {
}
}
}
+
+async fn learn_and_sing() {
+ let song = learn_song().await;
+ sing_song(song).await;
+}
+
+async fn async_main() {
+ let f1 = learn_and_sing();
+ let f2 = dance();
+ futures::join!(f1, f2);
+}
"#
.trim(),
expect_file!["./test_data/highlighting.html"],