From 1555a1aa0d5d45e4b317db272c07ad3e8470553d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Oct 2019 15:15:47 +0300 Subject: remove one more dependency on source roots --- crates/ra_hir/src/code_model.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir/src') 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; 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 { - 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 { + db.crate_graph().iter().map(|crate_id| Crate { crate_id }).collect() } } -- cgit v1.2.3