mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Ensure all existing doctest code highlights have documentation modifier
This commit is contained in:
parent
aae26bc5b8
commit
a951108173
3 changed files with 22 additions and 21 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue