diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index 62dc92feb1..83082496d5 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -593,7 +593,7 @@ fn filter_by_config(highlight: &mut Highlight, config: HighlightConfig) -> bool
*tag = HlTag::Punctuation(HlPunct::Other);
}
}
- HlTag::Punctuation(_) if !config.punctuation => return false,
+ HlTag::Punctuation(_) if !config.punctuation && highlight.mods.is_empty() => return false,
tag @ HlTag::Punctuation(_) if !config.specialize_punctuation => {
*tag = HlTag::Punctuation(HlPunct::Other);
}
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html b/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html
index 44905831e3..828b8f762c 100644
--- a/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html
+++ b/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html
@@ -101,10 +101,9 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
let Union { field: _ };
let Union { field };
- let Union { field: true };
let Union { field: field };
let Union { field: ref field };
- let Union { field: (ref field | 0) };
+ let Union { field: (_ | ref field) };
*&raw const*&*x;
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 504a1c970e..8f69bb8230 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -651,10 +651,9 @@ fn main() {
let Union { field: _ };
// but not these
let Union { field };
- let Union { field: true };
let Union { field: field };
let Union { field: ref field };
- let Union { field: (ref field | 0) };
+ let Union { field: (_ | ref field) };
// unsafe deref
*&raw const*&*x;
@@ -672,7 +671,7 @@ fn main() {
core::arch::asm!(
"push {base}",
- base$0 = const 0
+ base = const 0
);
}
}