diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/assists/src/utils.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crates/assists/src/utils.rs b/crates/assists/src/utils.rs index d15e5a24b..7c159b5ba 100644 --- a/crates/assists/src/utils.rs +++ b/crates/assists/src/utils.rs | |||
@@ -98,13 +98,14 @@ pub fn filter_assoc_items( | |||
98 | 98 | ||
99 | items | 99 | items |
100 | .iter() | 100 | .iter() |
101 | .map(|i| { | 101 | // Note: This throws away items with no source. |
102 | #[allow(deprecated)] | 102 | .filter_map(|i| { |
103 | match i { | 103 | let item = match i { |
104 | hir::AssocItem::Function(i) => ast::AssocItem::Fn(i.source_old(db).value), | 104 | hir::AssocItem::Function(i) => ast::AssocItem::Fn(i.source(db)?.value), |
105 | hir::AssocItem::TypeAlias(i) => ast::AssocItem::TypeAlias(i.source_old(db).value), | 105 | hir::AssocItem::TypeAlias(i) => ast::AssocItem::TypeAlias(i.source(db)?.value), |
106 | hir::AssocItem::Const(i) => ast::AssocItem::Const(i.source_old(db).value), | 106 | hir::AssocItem::Const(i) => ast::AssocItem::Const(i.source(db)?.value), |
107 | } | 107 | }; |
108 | Some(item) | ||
108 | }) | 109 | }) |
109 | .filter(has_def_name) | 110 | .filter(has_def_name) |
110 | .filter(|it| match it { | 111 | .filter(|it| match it { |