diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 18552459b11..62213dc4772 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(), diff --git a/crates/ide/src/syntax_highlighting/tags.rs b/crates/ide/src/syntax_highlighting/tags.rs index e58392d6738..336af3f4c90 100644 --- a/crates/ide/src/syntax_highlighting/tags.rs +++ b/crates/ide/src/syntax_highlighting/tags.rs @@ -47,21 +47,27 @@ pub enum HlMod { /// `foo` in `fn foo(x: i32)` is a definition, `foo` in `foo(90 + 2)` is /// not. Definition, + /// Doc-strings like this one. Documentation, + /// Highlighting injection like rust code in doc strings or ra_fixture. Injected, + /// Mutable binding. Mutable, + /// Value that is being consumed in a function call Consuming, + /// Callable item or value. Callable, - /// Used for associated functions + /// Used for associated functions. Static, - /// Used for items in impls&traits. + /// Used for items in traits and impls. Associated, /// Used for intra doc links in doc injection. IntraDocLink, /// Used for items in traits and trait impls. Trait, - /// Keep this last! + // Keep this last! + /// Used for unsafe functions, mutable statics, union accesses and unsafe operations. Unsafe, }