aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-04 11:17:41 +0000
committerAleksey Kladov <[email protected]>2020-03-04 11:22:47 +0000
commit994000b5ddfd5bb3b7dc7d66aabe02a0f337770f (patch)
treecb9256acc0a53c17a809b50b211d9655ff4a3da5 /crates/ra_ide
parente839d793ae4afd2a9ca2df1f6b4b3c56dce12ab8 (diff)
Use method instead of a free function
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/references.rs7
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
29pub(crate) use self::rename::rename; 29pub(crate) use self::rename::rename;
30 30
31pub use ra_ide_db::search::{ 31pub 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)]
36pub struct ReferenceSearchResult { 34pub 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();