diff options
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 9 |
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 854b6cc6d..f8f790e59 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -489,7 +489,14 @@ fn highlight_element( | |||
489 | } | 489 | } |
490 | 490 | ||
491 | // Simple token-based highlighting | 491 | // Simple token-based highlighting |
492 | COMMENT => HighlightTag::Comment.into(), | 492 | COMMENT => { |
493 | let comment = element.into_token().and_then(ast::Comment::cast)?; | ||
494 | let h = HighlightTag::Comment; | ||
495 | match comment.kind().doc { | ||
496 | Some(_) => h | HighlightModifier::Documentation, | ||
497 | None => h.into(), | ||
498 | } | ||
499 | } | ||
493 | STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => HighlightTag::StringLiteral.into(), | 500 | STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => HighlightTag::StringLiteral.into(), |
494 | ATTR => HighlightTag::Attribute.into(), | 501 | ATTR => HighlightTag::Attribute.into(), |
495 | INT_NUMBER | FLOAT_NUMBER => HighlightTag::NumericLiteral.into(), | 502 | INT_NUMBER | FLOAT_NUMBER => HighlightTag::NumericLiteral.into(), |