aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/references.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/references.rs')
-rw-r--r--crates/ide/src/references.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index f96fac9c1..77c208be9 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -66,12 +66,8 @@ pub(crate) fn find_all_refs(
66 let mut usages = def.usages(sema).set_scope(search_scope).all(); 66 let mut usages = def.usages(sema).set_scope(search_scope).all();
67 if let Some(ctor_filter) = ctor_filter { 67 if let Some(ctor_filter) = ctor_filter {
68 // filter for constructor-literals 68 // filter for constructor-literals
69 usages.references.iter_mut().for_each(|(&file_id, it)| { 69 usages.references.values_mut().for_each(|it| {
70 let root = sema.parse(file_id); 70 it.retain(|reference| reference.name.as_name_ref().map_or(false, ctor_filter));
71 let root = root.syntax();
72 it.retain(|reference| {
73 reference.as_name_ref(root).map_or(false, |name_ref| ctor_filter(&name_ref))
74 })
75 }); 71 });
76 usages.references.retain(|_, it| !it.is_empty()); 72 usages.references.retain(|_, it| !it.is_empty());
77 } 73 }