From 3f1c73633eb3e5d8a2df3a72dc772087cfb18be4 Mon Sep 17 00:00:00 2001 From: George Fraser Date: Sun, 10 May 2020 11:08:32 -0700 Subject: Color `in` as a control keyword --- crates/ra_ide/src/snapshots/highlighting.html | 4 ++++ crates/ra_ide/src/syntax_highlighting.rs | 3 ++- crates/ra_ide/src/syntax_highlighting/tests.rs | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 4c27aade4..c67df5c39 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 d53a39f57..16123c5cb 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 13894869c..7975755b2 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; -- cgit v1.2.3