aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-06 09:59:53 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-06 09:59:53 +0100
commitcf5d478b674e49906b129d7ed706ec5fb367ddc8 (patch)
treea0715e48cd7330aeebd9c7520dbeedb54a49f0c8 /crates/ra_lsp_server/src
parente01c6b4e1bdd52744c278d423e32dbaf82cd6c56 (diff)
parent6cf56b66156c2e321d44a51df726cd4061334ba3 (diff)
Merge #1655
1655: cleanup imports r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs2
-rw-r--r--crates/ra_lsp_server/src/vfs_filter.rs18
-rw-r--r--crates/ra_lsp_server/src/world.rs2
3 files changed, 11 insertions, 11 deletions
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(
269 && pending_libraries.is_empty() 269 && pending_libraries.is_empty()
270 && in_flight_libraries == 0 270 && in_flight_libraries == 0
271 { 271 {
272 let n_packages: usize = state.workspaces.iter().map(|it| it.count()).sum(); 272 let n_packages: usize = state.workspaces.iter().map(|it| it.n_packages()).sum();
273 if state.options.show_workspace_loaded { 273 if state.options.show_workspace_loaded {
274 let msg = format!("workspace loaded, {} rust packages", n_packages); 274 let msg = format!("workspace loaded, {} rust packages", n_packages);
275 show_message(req::MessageType::Info, msg, msg_sender); 275 show_message(req::MessageType::Info, msg, msg_sender);
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 @@
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 std::convert::From<ProjectRoot> for IncludeRustFiles { 43impl std::convert::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}
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 {
211 } else { 211 } else {
212 res.push_str("workspaces:\n"); 212 res.push_str("workspaces:\n");
213 for w in self.workspaces.iter() { 213 for w in self.workspaces.iter() {
214 res += &format!("{} packages loaded\n", w.count()); 214 res += &format!("{} packages loaded\n", w.n_packages());
215 } 215 }
216 } 216 }
217 res.push_str("\nanalysis:\n"); 217 res.push_str("\nanalysis:\n");