From a951108173349f9ff0b9936ec2af8881fd92fc98 Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Wed, 17 Jun 2020 09:33:21 -0400 Subject: Ensure all existing doctest code highlights have documentation modifier --- crates/ra_ide/src/syntax_highlighting.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide/src/syntax_highlighting.rs') 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( // Simple token-based highlighting COMMENT => { let comment = element.into_token().and_then(ast::Comment::cast)?; - if comment.kind().doc.is_some() { - Highlight::from(HighlightTag::Comment) | HighlightModifier::Documentation - } else { - HighlightTag::Comment.into() + let h = HighlightTag::Comment; + match comment.kind().doc { + Some(_) => h | HighlightModifier::Documentation, + None => h.into(), } } STRING | RAW_STRING | RAW_BYTE_STRING | BYTE_STRING => HighlightTag::StringLiteral.into(), -- cgit v1.2.3