mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Parse extended_key_value_attributes
This commit is contained in:
parent
816bc73895
commit
4771a56791
7 changed files with 32 additions and 41 deletions
|
@ -277,9 +277,9 @@ pub(super) fn doc_comment(hl: &mut Highlights, sema: &Semantics<RootDatabase>, n
|
|||
}
|
||||
|
||||
fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::String> {
|
||||
match it.literal() {
|
||||
match it.expr() {
|
||||
// #[doc = lit]
|
||||
Some(lit) => match lit.kind() {
|
||||
Some(ast::Expr::Literal(lit)) => match lit.kind() {
|
||||
ast::LiteralKind::String(it) => Some(it),
|
||||
_ => None,
|
||||
},
|
||||
|
@ -297,6 +297,7 @@ fn find_doc_string_in_attr(attr: &hir::Attr, it: &ast::Attr) -> Option<ast::Stri
|
|||
string.text().get(1..string.text().len() - 1).map_or(false, |it| it == text)
|
||||
})
|
||||
}
|
||||
_ => return None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue