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_lsp_server/src/vfs_filter.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/src/vfs_filter.rs b/crates/ra_lsp_server/src/vfs_filter.rs index e16a57da5..abdc8dbad 100644 --- a/crates/ra_lsp_server/src/vfs_filter.rs +++ b/crates/ra_lsp_server/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 std::convert::From for IncludeRustFiles { - fn from(v: ProjectRoot) -> IncludeRustFiles { +impl std::convert::From for IncludeRustFiles { + fn from(v: PackageRoot) -> IncludeRustFiles { IncludeRustFiles { root: v } } } -- cgit v1.2.3 From d751bd08bfa36bd8abdcbb4fa466022720094b7d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Aug 2019 10:54:51 +0200 Subject: cleanup --- crates/ra_lsp_server/src/main_loop.rs | 2 +- crates/ra_lsp_server/src/world.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 8e830c8b8..9a38d43d2 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -269,7 +269,7 @@ fn main_loop_inner( && pending_libraries.is_empty() && in_flight_libraries == 0 { - let n_packages: usize = state.workspaces.iter().map(|it| it.count()).sum(); + let n_packages: usize = state.workspaces.iter().map(|it| it.n_packages()).sum(); if state.options.show_workspace_loaded { let msg = format!("workspace loaded, {} rust packages", n_packages); show_message(req::MessageType::Info, msg, msg_sender); diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs index 1d7755910..b57cdf925 100644 --- a/crates/ra_lsp_server/src/world.rs +++ b/crates/ra_lsp_server/src/world.rs @@ -211,7 +211,7 @@ impl WorldSnapshot { } else { res.push_str("workspaces:\n"); for w in self.workspaces.iter() { - res += &format!("{} packages loaded\n", w.count()); + res += &format!("{} packages loaded\n", w.n_packages()); } } res.push_str("\nanalysis:\n"); -- cgit v1.2.3