aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/syntax_highlighting.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index 5a4de450c..68dff45b7 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -475,7 +475,14 @@ fn highlight_element(
475 } 475 }
476 476
477 // Simple token-based highlighting 477 // Simple token-based highlighting
478 COMMENT => HighlightTag::Comment.into(), 478 COMMENT => {
479 let comment = element.into_token().and_then(ast::Comment::cast)?;
480 if comment.kind().doc.is_some() {
481 Highlight::from(HighlightTag::Comment) | HighlightModifier::Documentation
482 } else {
483 HighlightTag::Comment.into()
484 }
485 }
479 STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => HighlightTag::StringLiteral.into(), 486 STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => HighlightTag::StringLiteral.into(),
480 ATTR => HighlightTag::Attribute.into(), 487 ATTR => HighlightTag::Attribute.into(),
481 INT_NUMBER | FLOAT_NUMBER => HighlightTag::NumericLiteral.into(), 488 INT_NUMBER | FLOAT_NUMBER => HighlightTag::NumericLiteral.into(),