aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/syntax_highlighting/inject.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ide/src/syntax_highlighting/inject.rs b/crates/ide/src/syntax_highlighting/inject.rs
index f359eacf2..5722dea3a 100644
--- a/crates/ide/src/syntax_highlighting/inject.rs
+++ b/crates/ide/src/syntax_highlighting/inject.rs
@@ -295,9 +295,9 @@ pub(super) fn doc_comment(
295} 295}
296 296
297fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::String> { 297fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::String> {
298 match it.literal() { 298 match it.expr() {
299 // #[doc = lit] 299 // #[doc = lit]
300 Some(lit) => match lit.kind() { 300 Some(ast::Expr::Literal(lit)) => match lit.kind() {
301 ast::LiteralKind::String(it) => Some(it), 301 ast::LiteralKind::String(it) => Some(it),
302 _ => None, 302 _ => None,
303 }, 303 },
@@ -315,6 +315,7 @@ fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::Stri
315 string.text().get(1..string.text().len() - 1).map_or(false, |it| it == text) 315 string.text().get(1..string.text().len() - 1).map_or(false, |it| it == text)
316 }) 316 })
317 } 317 }
318 _ => return None,
318 } 319 }
319} 320}
320 321