aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-14 13:15:47 +0100
committerAleksey Kladov <[email protected]>2019-10-14 13:15:47 +0100
commit1555a1aa0d5d45e4b317db272c07ad3e8470553d (patch)
treef16b9bfdb058055b72e587ef4ac23b106e06ee7e /crates/ra_hir
parent77f2dd96a122e59a8d8df8afb53a741df9b1af76 (diff)
remove one more dependency on source roots
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 8055a07db..8eb3c577d 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -5,7 +5,7 @@ pub(crate) mod docs;
5 5
6use std::sync::Arc; 6use std::sync::Arc;
7 7
8use ra_db::{CrateId, Edition, FileId, SourceRootId}; 8use ra_db::{CrateId, Edition, FileId};
9use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner}; 9use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner};
10 10
11use crate::{ 11use crate::{
@@ -76,10 +76,8 @@ impl Crate {
76 crate_graph.edition(self.crate_id) 76 crate_graph.edition(self.crate_id)
77 } 77 }
78 78
79 // FIXME: should this be in source_binder? 79 pub fn all(db: &impl DefDatabase) -> Vec<Crate> {
80 pub fn source_root_crates(db: &impl DefDatabase, source_root: SourceRootId) -> Vec<Crate> { 80 db.crate_graph().iter().map(|crate_id| Crate { crate_id }).collect()
81 let crate_ids = db.source_root_crates(source_root);
82 crate_ids.iter().map(|&crate_id| Crate { crate_id }).collect()
83 } 81 }
84} 82}
85 83