From c005ce60a048a5df79b93ce45911ab0c6952a41b Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 23 Apr 2021 16:43:48 +0200 Subject: Tag `yield` and `await` as ControlFlow in semantic highlighting --- crates/ide/src/syntax_highlighting/highlight.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/ide/src/syntax_highlighting/highlight.rs') diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 18552459b..62213dc47 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -254,15 +254,17 @@ pub(super) fn element( k if k.is_keyword() => { let h = Highlight::new(HlTag::Keyword); match k { - T![break] + T![await] + | T![break] | T![continue] | T![else] | T![if] + | T![in] | T![loop] | T![match] | T![return] | T![while] - | T![in] => h | HlMod::ControlFlow, + | T![yield] => h | HlMod::ControlFlow, T![for] if !is_child_of_impl(&element) => h | HlMod::ControlFlow, T![unsafe] => h | HlMod::Unsafe, T![true] | T![false] => HlTag::BoolLiteral.into(), -- cgit v1.2.3