diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 4c27aade4025..c67df5c39afa 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html @@ -63,6 +63,10 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd STATIC_MUT = 1; } + for e in vec { + // Do nothing + } + let mut x = 42; let y = &mut x; let z = &y; diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index d53a39f57b52..16123c5cb473 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -408,7 +408,8 @@ fn highlight_element( | T![loop] | T![match] | T![return] - | T![while] => h | HighlightModifier::ControlFlow, + | T![while] + | T![in] => h | HighlightModifier::ControlFlow, T![unsafe] => h | HighlightModifier::Unsafe, _ => h, } diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index 13894869c8bf..7975755b29c5 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs @@ -47,6 +47,10 @@ fn main() { STATIC_MUT = 1; } + for e in vec { + // Do nothing + } + let mut x = 42; let y = &mut x; let z = &y;