mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-15 10:12:21 +00:00
Ignore doc(hidden) attr if no body is present
This commit is contained in:
parent
c1c9e10f72
commit
b0101da116
2 changed files with 43 additions and 2 deletions
|
|
@ -106,8 +106,18 @@ pub fn filter_assoc_items(
|
|||
.iter()
|
||||
.copied()
|
||||
.filter(|assoc_item| {
|
||||
!(ignore_items == IgnoreAssocItems::DocHiddenAttrPresent
|
||||
&& assoc_item.attrs(sema.db).has_doc_hidden())
|
||||
if ignore_items == IgnoreAssocItems::DocHiddenAttrPresent
|
||||
&& assoc_item.attrs(sema.db).has_doc_hidden()
|
||||
{
|
||||
if let hir::AssocItem::Function(f) = assoc_item {
|
||||
if !f.has_body(sema.db) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
// Note: This throws away items with no source.
|
||||
.filter_map(|assoc_item| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue