diff options
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/references.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index abecca2bb..6440707d7 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs | |||
@@ -28,9 +28,7 @@ use crate::{display::TryToNav, FilePosition, FileRange, NavigationTarget, RangeI | |||
28 | 28 | ||
29 | pub(crate) use self::rename::rename; | 29 | pub(crate) use self::rename::rename; |
30 | 30 | ||
31 | pub use ra_ide_db::search::{ | 31 | pub use ra_ide_db::search::{Reference, ReferenceAccess, ReferenceKind, SearchScope}; |
32 | find_refs_to_def, Reference, ReferenceAccess, ReferenceKind, SearchScope, | ||
33 | }; | ||
34 | 32 | ||
35 | #[derive(Debug, Clone)] | 33 | #[derive(Debug, Clone)] |
36 | pub struct ReferenceSearchResult { | 34 | pub struct ReferenceSearchResult { |
@@ -105,7 +103,8 @@ pub(crate) fn find_all_refs( | |||
105 | 103 | ||
106 | let RangeInfo { range, info: def } = find_name(&sema, &syntax, position, opt_name)?; | 104 | let RangeInfo { range, info: def } = find_name(&sema, &syntax, position, opt_name)?; |
107 | 105 | ||
108 | let references = find_refs_to_def(db, &def, search_scope) | 106 | let references = def |
107 | .find_usages(db, search_scope) | ||
109 | .into_iter() | 108 | .into_iter() |
110 | .filter(|r| search_kind == ReferenceKind::Other || search_kind == r.kind) | 109 | .filter(|r| search_kind == ReferenceKind::Other || search_kind == r.kind) |
111 | .collect(); | 110 | .collect(); |