diff options
author | Paul Daniel Faria <[email protected]> | 2020-06-17 14:33:21 +0100 |
---|---|---|
committer | Paul Daniel Faria <[email protected]> | 2020-06-17 14:33:21 +0100 |
commit | a951108173349f9ff0b9936ec2af8881fd92fc98 (patch) | |
tree | ebb7d11259f69534a167aff03abf579afaa3fe30 /crates/ra_ide/src/syntax_highlighting.rs | |
parent | aae26bc5b864971ef54f4d95d5ed89a6436334e2 (diff) |
Ensure all existing doctest code highlights have documentation modifier
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 68dff45b7..6c43c5d94 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -477,10 +477,10 @@ fn highlight_element( | |||
477 | // Simple token-based highlighting | 477 | // Simple token-based highlighting |
478 | COMMENT => { | 478 | COMMENT => { |
479 | let comment = element.into_token().and_then(ast::Comment::cast)?; | 479 | let comment = element.into_token().and_then(ast::Comment::cast)?; |
480 | if comment.kind().doc.is_some() { | 480 | let h = HighlightTag::Comment; |
481 | Highlight::from(HighlightTag::Comment) | HighlightModifier::Documentation | 481 | match comment.kind().doc { |
482 | } else { | 482 | Some(_) => h | HighlightModifier::Documentation, |
483 | HighlightTag::Comment.into() | 483 | None => h.into(), |
484 | } | 484 | } |
485 | } | 485 | } |
486 | STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => HighlightTag::StringLiteral.into(), | 486 | STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => HighlightTag::StringLiteral.into(), |