aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-03-18 21:25:10 +0000
committerLukas Wirth <[email protected]>2021-03-19 01:13:46 +0000
commit4771a5679188177e653262e69ed7e33b4bf60c65 (patch)
tree9cd52bcda5a72f00b176681d13897b938297fb9a /crates/ide/src/syntax_highlighting
parent816bc7389516dda1eb4821f2ac4d5993cd5611dd (diff)
Parse extended_key_value_attributes
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-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 947cc974c..90feb6c18 100644
--- a/crates/ide/src/syntax_highlighting/inject.rs
+++ b/crates/ide/src/syntax_highlighting/inject.rs
@@ -277,9 +277,9 @@ pub(super) fn doc_comment(hl: &mut Highlights, sema: &Semantics<RootDatabase>, n
277} 277}
278 278
279fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::String> { 279fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::String> {
280 match it.literal() { 280 match it.expr() {
281 // #[doc = lit] 281 // #[doc = lit]
282 Some(lit) => match lit.kind() { 282 Some(ast::Expr::Literal(lit)) => match lit.kind() {
283 ast::LiteralKind::String(it) => Some(it), 283 ast::LiteralKind::String(it) => Some(it),
284 _ => None, 284 _ => None,
285 }, 285 },
@@ -297,6 +297,7 @@ fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::Stri
297 string.text().get(1..string.text().len() - 1).map_or(false, |it| it == text) 297 string.text().get(1..string.text().len() - 1).map_or(false, |it| it == text)
298 }) 298 })
299 } 299 }
300 _ => return None,
300 } 301 }
301} 302}
302 303