Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting.rs')
-rw-r--r--crates/ide/src/syntax_highlighting.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index e7c5f95a25..e64fd6488f 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -513,21 +513,21 @@ fn string_injections(
);
if !string.is_raw() {
- highlight_escape_string(hl, &string);
+ highlight_escape_string(hl, config, &string);
}
}
} else if let Some(byte_string) = ast::ByteString::cast(token.clone()) {
if !byte_string.is_raw() {
- highlight_escape_string(hl, &byte_string);
+ highlight_escape_string(hl, config, &byte_string);
}
} else if let Some(c_string) = ast::CString::cast(token.clone()) {
if !c_string.is_raw() {
- highlight_escape_string(hl, &c_string);
+ highlight_escape_string(hl, config, &c_string);
}
} else if let Some(char) = ast::Char::cast(token.clone()) {
- highlight_escape_char(hl, &char)
+ highlight_escape_char(hl, config, &char)
} else if let Some(byte) = ast::Byte::cast(token) {
- highlight_escape_byte(hl, &byte)
+ highlight_escape_byte(hl, config, &byte)
}
ControlFlow::Continue(())
}
@@ -586,7 +586,11 @@ fn descend_token(
fn filter_by_config(highlight: &mut Highlight, config: &HighlightConfig<'_>) -> bool {
match &mut highlight.tag {
- HlTag::StringLiteral if !config.strings => return false,
+ HlTag::StringLiteral | HlTag::EscapeSequence | HlTag::InvalidEscapeSequence
+ if !config.strings =>
+ {
+ return false;
+ }
HlTag::Comment if !config.comments => return false,
// If punctuation is disabled, make the macro bang part of the macro call again.
tag @ HlTag::Punctuation(HlPunct::MacroBang) => {