From 0e4a542cfb366898a4d53701c50ae4d1732d7c53 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Aug 2019 10:50:32 +0200 Subject: rename --- crates/ra_batch/src/lib.rs | 6 +++--- crates/ra_batch/src/vfs_filter.rs | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'crates/ra_batch/src') diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index c25737aaa..c01574fbc 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs @@ -6,7 +6,7 @@ use rustc_hash::FxHashMap; use ra_db::{CrateGraph, FileId, SourceRootId}; use ra_ide_api::{AnalysisChange, AnalysisHost}; -use ra_project_model::{ProjectRoot, ProjectWorkspace}; +use ra_project_model::{PackageRoot, ProjectWorkspace}; use ra_vfs::{Vfs, VfsChange}; use vfs_filter::IncludeRustFiles; @@ -19,7 +19,7 @@ fn vfs_root_to_id(r: ra_vfs::VfsRoot) -> SourceRootId { SourceRootId(r.0) } -pub fn load_cargo(root: &Path) -> Result<(AnalysisHost, FxHashMap)> { +pub fn load_cargo(root: &Path) -> Result<(AnalysisHost, FxHashMap)> { let root = std::env::current_dir()?.join(root); let ws = ProjectWorkspace::discover(root.as_ref())?; let project_roots = ws.to_roots(); @@ -48,7 +48,7 @@ pub fn load_cargo(root: &Path) -> Result<(AnalysisHost, FxHashMap, + source_roots: &FxHashMap, crate_graph: CrateGraph, vfs: &mut Vfs, ) -> AnalysisHost { diff --git a/crates/ra_batch/src/vfs_filter.rs b/crates/ra_batch/src/vfs_filter.rs index 2f0d8cb8b..63bf77704 100644 --- a/crates/ra_batch/src/vfs_filter.rs +++ b/crates/ra_batch/src/vfs_filter.rs @@ -1,32 +1,32 @@ -use ra_project_model::ProjectRoot; +use ra_project_model::PackageRoot; use ra_vfs::{Filter, RelativePath, RootEntry}; use std::path::PathBuf; /// `IncludeRustFiles` is used to convert -/// from `ProjectRoot` to `RootEntry` for VFS +/// from `PackageRoot` to `RootEntry` for VFS pub struct IncludeRustFiles { - root: ProjectRoot, + root: PackageRoot, } impl IncludeRustFiles { pub fn from_roots(roots: R) -> impl Iterator where - R: IntoIterator, + R: IntoIterator, { roots.into_iter().map(IncludeRustFiles::from_root) } - pub fn from_root(root: ProjectRoot) -> RootEntry { + pub fn from_root(root: PackageRoot) -> RootEntry { IncludeRustFiles::from(root).into() } #[allow(unused)] pub fn external(path: PathBuf) -> RootEntry { - IncludeRustFiles::from_root(ProjectRoot::new(path, false)) + IncludeRustFiles::from_root(PackageRoot::new(path, false)) } pub fn member(path: PathBuf) -> RootEntry { - IncludeRustFiles::from_root(ProjectRoot::new(path, true)) + IncludeRustFiles::from_root(PackageRoot::new(path, true)) } } @@ -40,8 +40,8 @@ impl Filter for IncludeRustFiles { } } -impl From for IncludeRustFiles { - fn from(v: ProjectRoot) -> IncludeRustFiles { +impl From for IncludeRustFiles { + fn from(v: PackageRoot) -> IncludeRustFiles { IncludeRustFiles { root: v } } } -- cgit v1.2.3