aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-19 11:38:40 +0000
committerGitHub <[email protected]>2021-03-19 11:38:40 +0000
commit7200b994c9b1eeb97e80a3a64ca51ec452ab888b (patch)
tree4bde423fd1a54c34286b7b65e9b2c062ddbd3d99 /crates/ide/src
parent98d29d4f538899a8bd8caac7f4d2459438a1ae9a (diff)
parent4771a5679188177e653262e69ed7e33b4bf60c65 (diff)
Merge #8097
8097: Parse extended_key_value_attributes r=jonas-schievink a=Veykril Companion PR https://github.com/rust-analyzer/ungrammar/pull/31 Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide/src')
-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