mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
remove one more dependency on source roots
This commit is contained in:
parent
77f2dd96a1
commit
1555a1aa0d
3 changed files with 26 additions and 21 deletions
|
@ -5,7 +5,7 @@ pub(crate) mod docs;
|
|||
|
||||
use std::sync::Arc;
|
||||
|
||||
use ra_db::{CrateId, Edition, FileId, SourceRootId};
|
||||
use ra_db::{CrateId, Edition, FileId};
|
||||
use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner};
|
||||
|
||||
use crate::{
|
||||
|
@ -76,10 +76,8 @@ impl Crate {
|
|||
crate_graph.edition(self.crate_id)
|
||||
}
|
||||
|
||||
// FIXME: should this be in source_binder?
|
||||
pub fn source_root_crates(db: &impl DefDatabase, source_root: SourceRootId) -> Vec<Crate> {
|
||||
let crate_ids = db.source_root_crates(source_root);
|
||||
crate_ids.iter().map(|&crate_id| Crate { crate_id }).collect()
|
||||
pub fn all(db: &impl DefDatabase) -> Vec<Crate> {
|
||||
db.crate_graph().iter().map(|crate_id| Crate { crate_id }).collect()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue