diff options
author | David Wood <[email protected]> | 2019-03-05 21:29:23 +0000 |
---|---|---|
committer | David Wood <[email protected]> | 2019-03-07 00:05:03 +0000 |
commit | 00d927a1885ec2938d3365a8e136993445b437f5 (patch) | |
tree | e60f63e68def477d5b7ceb39dcc965ff128d6e19 /crates/ra_lsp_server/src/server_world.rs | |
parent | b1a1d20e067c25fb80fbab43b2956b6747a8dd3c (diff) |
Initial implementation of project-lock.json.
This commit adds a initial implementation of project-lock.json, a build
system agnostic method of specifying the crate graph and roots.
Diffstat (limited to 'crates/ra_lsp_server/src/server_world.rs')
-rw-r--r-- | crates/ra_lsp_server/src/server_world.rs | 9 |
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..4625a26a7 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 | ws.add_roots(&mut 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"); |