aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/syntax_highlighting.rs')
-rw-r--r--crates/ide/src/syntax_highlighting.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index efcc8ecfe..05bafe9c8 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -179,10 +179,12 @@ pub(crate) fn highlight(
179 element.clone() 179 element.clone()
180 }; 180 };
181 181
182 if let Some(token) = element.as_token().cloned().and_then(ast::RawString::cast) { 182 if let Some(token) = element.as_token().cloned().and_then(ast::String::cast) {
183 let expanded = element_to_highlight.as_token().unwrap().clone(); 183 if token.is_raw() {
184 if injection::highlight_injection(&mut stack, &sema, token, expanded).is_some() { 184 let expanded = element_to_highlight.as_token().unwrap().clone();
185 continue; 185 if injection::highlight_injection(&mut stack, &sema, token, expanded).is_some() {
186 continue;
187 }
186 } 188 }
187 } 189 }
188 190
@@ -214,10 +216,6 @@ pub(crate) fn highlight(
214 } 216 }
215 stack.pop_and_inject(None); 217 stack.pop_and_inject(None);
216 } 218 }
217 } else if let Some(string) =
218 element_to_highlight.as_token().cloned().and_then(ast::RawString::cast)
219 {
220 format_string_highlighter.highlight_format_string(&mut stack, &string, range);
221 } 219 }
222 } 220 }
223 } 221 }
@@ -532,7 +530,7 @@ fn highlight_element(
532 None => h.into(), 530 None => h.into(),
533 } 531 }
534 } 532 }
535 STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => HighlightTag::StringLiteral.into(), 533 STRING | BYTE_STRING => HighlightTag::StringLiteral.into(),
536 ATTR => HighlightTag::Attribute.into(), 534 ATTR => HighlightTag::Attribute.into(),
537 INT_NUMBER | FLOAT_NUMBER => HighlightTag::NumericLiteral.into(), 535 INT_NUMBER | FLOAT_NUMBER => HighlightTag::NumericLiteral.into(),
538 BYTE => HighlightTag::ByteLiteral.into(), 536 BYTE => HighlightTag::ByteLiteral.into(),