aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/references/search_scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/references/search_scope.rs')
-rw-r--r--crates/ra_ide_api/src/references/search_scope.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/references/search_scope.rs b/crates/ra_ide_api/src/references/search_scope.rs
index b6eb248b7..f2789e0b2 100644
--- a/crates/ra_ide_api/src/references/search_scope.rs
+++ b/crates/ra_ide_api/src/references/search_scope.rs
@@ -111,8 +111,7 @@ impl NameDefinition {
111 if vis.as_str() != "" { 111 if vis.as_str() != "" {
112 let source_root_id = db.file_source_root(file_id); 112 let source_root_id = db.file_source_root(file_id);
113 let source_root = db.source_root(source_root_id); 113 let source_root = db.source_root(source_root_id);
114 let mut res = 114 let mut res = source_root.walk().map(|id| (id, None)).collect::<FxHashMap<_, _>>();
115 source_root.walk().map(|id| (id.into(), None)).collect::<FxHashMap<_, _>>();
116 115
117 // FIXME: add "pub(in path)" 116 // FIXME: add "pub(in path)"
118 117
@@ -120,7 +119,7 @@ impl NameDefinition {
120 return SearchScope::new(res); 119 return SearchScope::new(res);
121 } 120 }
122 if vis.as_str() == "pub" { 121 if vis.as_str() == "pub" {
123 let krate = self.container.krate(db).unwrap(); 122 let krate = self.container.krate();
124 let crate_graph = db.crate_graph(); 123 let crate_graph = db.crate_graph();
125 for crate_id in crate_graph.iter() { 124 for crate_id in crate_graph.iter() {
126 let mut crate_deps = crate_graph.dependencies(crate_id); 125 let mut crate_deps = crate_graph.dependencies(crate_id);
@@ -128,7 +127,7 @@ impl NameDefinition {
128 let root_file = crate_graph.crate_root(crate_id); 127 let root_file = crate_graph.crate_root(crate_id);
129 let source_root_id = db.file_source_root(root_file); 128 let source_root_id = db.file_source_root(root_file);
130 let source_root = db.source_root(source_root_id); 129 let source_root = db.source_root(source_root_id);
131 res.extend(source_root.walk().map(|id| (id.into(), None))); 130 res.extend(source_root.walk().map(|id| (id, None)));
132 } 131 }
133 } 132 }
134 return SearchScope::new(res); 133 return SearchScope::new(res);