aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/server_world.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-03-07 11:36:04 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-03-07 11:36:04 +0000
commit5232099977d07492c1b6d5e6163c70d4f6eb07df (patch)
tree0660079034d3c2f30147e946f2c473d2f651eef2 /crates/ra_lsp_server/src/server_world.rs
parentb94e1eee8341cb2a16b89711d65b382549fd2bde (diff)
parent4cd757c1e32f0cf1f281b82cd55615d0e47edb24 (diff)
Merge #939
939: Initial implementation of project-lock.json. r=davidtwco a=davidtwco Fixes #792. This PR adds a initial implementation of project-lock.json, a build system agnostic method of specifying the crate graph and roots. Co-authored-by: David Wood <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src/server_world.rs')
-rw-r--r--crates/ra_lsp_server/src/server_world.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs
index 4a68c019f..7163568b9 100644
--- a/crates/ra_lsp_server/src/server_world.rs
+++ b/crates/ra_lsp_server/src/server_world.rs
@@ -40,12 +40,7 @@ impl ServerWorldState {
40 let mut roots = Vec::new(); 40 let mut roots = Vec::new();
41 roots.push(root.clone()); 41 roots.push(root.clone());
42 for ws in workspaces.iter() { 42 for ws in workspaces.iter() {
43 for pkg in ws.cargo.packages() { 43 roots.extend(ws.to_roots());
44 roots.push(pkg.root(&ws.cargo).to_path_buf());
45 }
46 for krate in ws.sysroot.crates() {
47 roots.push(krate.root_dir(&ws.sysroot).to_path_buf())
48 }
49 } 44 }
50 let (mut vfs, roots) = Vfs::new(roots); 45 let (mut vfs, roots) = Vfs::new(roots);
51 let roots_to_scan = roots.len(); 46 let roots_to_scan = roots.len();
@@ -185,7 +180,7 @@ impl ServerWorld {
185 } else { 180 } else {
186 res.push_str("workspaces:\n"); 181 res.push_str("workspaces:\n");
187 for w in self.workspaces.iter() { 182 for w in self.workspaces.iter() {
188 res += &format!("{} packages loaded\n", w.cargo.packages().count()); 183 res += &format!("{} packages loaded\n", w.count());
189 } 184 }
190 } 185 }
191 res.push_str("\nanalysis:\n"); 186 res.push_str("\nanalysis:\n");