aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_batch/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-06 09:50:32 +0100
committerAleksey Kladov <[email protected]>2019-08-06 09:50:32 +0100
commit0e4a542cfb366898a4d53701c50ae4d1732d7c53 (patch)
tree2daa81772f85bb73c888fa533c377942cac4aa05 /crates/ra_batch/src
parente01c6b4e1bdd52744c278d423e32dbaf82cd6c56 (diff)
rename
Diffstat (limited to 'crates/ra_batch/src')
-rw-r--r--crates/ra_batch/src/lib.rs6
-rw-r--r--crates/ra_batch/src/vfs_filter.rs18
2 files changed, 12 insertions, 12 deletions
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;
6 6
7use ra_db::{CrateGraph, FileId, SourceRootId}; 7use ra_db::{CrateGraph, FileId, SourceRootId};
8use ra_ide_api::{AnalysisChange, AnalysisHost}; 8use ra_ide_api::{AnalysisChange, AnalysisHost};
9use ra_project_model::{ProjectRoot, ProjectWorkspace}; 9use ra_project_model::{PackageRoot, ProjectWorkspace};
10use ra_vfs::{Vfs, VfsChange}; 10use ra_vfs::{Vfs, VfsChange};
11use vfs_filter::IncludeRustFiles; 11use vfs_filter::IncludeRustFiles;
12 12
@@ -19,7 +19,7 @@ fn vfs_root_to_id(r: ra_vfs::VfsRoot) -> SourceRootId {
19 SourceRootId(r.0) 19 SourceRootId(r.0)
20} 20}
21 21
22pub fn load_cargo(root: &Path) -> Result<(AnalysisHost, FxHashMap<SourceRootId, ProjectRoot>)> { 22pub fn load_cargo(root: &Path) -> Result<(AnalysisHost, FxHashMap<SourceRootId, PackageRoot>)> {
23 let root = std::env::current_dir()?.join(root); 23 let root = std::env::current_dir()?.join(root);
24 let ws = ProjectWorkspace::discover(root.as_ref())?; 24 let ws = ProjectWorkspace::discover(root.as_ref())?;
25 let project_roots = ws.to_roots(); 25 let project_roots = ws.to_roots();
@@ -48,7 +48,7 @@ pub fn load_cargo(root: &Path) -> Result<(AnalysisHost, FxHashMap<SourceRootId,
48} 48}
49 49
50pub fn load( 50pub fn load(
51 source_roots: &FxHashMap<SourceRootId, ProjectRoot>, 51 source_roots: &FxHashMap<SourceRootId, PackageRoot>,
52 crate_graph: CrateGraph, 52 crate_graph: CrateGraph,
53 vfs: &mut Vfs, 53 vfs: &mut Vfs,
54) -> AnalysisHost { 54) -> 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 @@
1use ra_project_model::ProjectRoot; 1use ra_project_model::PackageRoot;
2use ra_vfs::{Filter, RelativePath, RootEntry}; 2use ra_vfs::{Filter, RelativePath, RootEntry};
3use std::path::PathBuf; 3use std::path::PathBuf;
4 4
5/// `IncludeRustFiles` is used to convert 5/// `IncludeRustFiles` is used to convert
6/// from `ProjectRoot` to `RootEntry` for VFS 6/// from `PackageRoot` to `RootEntry` for VFS
7pub struct IncludeRustFiles { 7pub struct IncludeRustFiles {
8 root: ProjectRoot, 8 root: PackageRoot,
9} 9}
10 10
11impl IncludeRustFiles { 11impl IncludeRustFiles {
12 pub fn from_roots<R>(roots: R) -> impl Iterator<Item = RootEntry> 12 pub fn from_roots<R>(roots: R) -> impl Iterator<Item = RootEntry>
13 where 13 where
14 R: IntoIterator<Item = ProjectRoot>, 14 R: IntoIterator<Item = PackageRoot>,
15 { 15 {
16 roots.into_iter().map(IncludeRustFiles::from_root) 16 roots.into_iter().map(IncludeRustFiles::from_root)
17 } 17 }
18 18
19 pub fn from_root(root: ProjectRoot) -> RootEntry { 19 pub fn from_root(root: PackageRoot) -> RootEntry {
20 IncludeRustFiles::from(root).into() 20 IncludeRustFiles::from(root).into()
21 } 21 }
22 22
23 #[allow(unused)] 23 #[allow(unused)]
24 pub fn external(path: PathBuf) -> RootEntry { 24 pub fn external(path: PathBuf) -> RootEntry {
25 IncludeRustFiles::from_root(ProjectRoot::new(path, false)) 25 IncludeRustFiles::from_root(PackageRoot::new(path, false))
26 } 26 }
27 27
28 pub fn member(path: PathBuf) -> RootEntry { 28 pub fn member(path: PathBuf) -> RootEntry {
29 IncludeRustFiles::from_root(ProjectRoot::new(path, true)) 29 IncludeRustFiles::from_root(PackageRoot::new(path, true))
30 } 30 }
31} 31}
32 32
@@ -40,8 +40,8 @@ impl Filter for IncludeRustFiles {
40 } 40 }
41} 41}
42 42
43impl From<ProjectRoot> for IncludeRustFiles { 43impl From<PackageRoot> for IncludeRustFiles {
44 fn from(v: ProjectRoot) -> IncludeRustFiles { 44 fn from(v: PackageRoot) -> IncludeRustFiles {
45 IncludeRustFiles { root: v } 45 IncludeRustFiles { root: v }
46 } 46 }
47} 47}