diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-07 11:36:04 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-07 11:36:04 +0000 |
commit | 5232099977d07492c1b6d5e6163c70d4f6eb07df (patch) | |
tree | 0660079034d3c2f30147e946f2c473d2f651eef2 /crates/ra_batch | |
parent | b94e1eee8341cb2a16b89711d65b382549fd2bde (diff) | |
parent | 4cd757c1e32f0cf1f281b82cd55615d0e47edb24 (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_batch')
-rw-r--r-- | crates/ra_batch/src/lib.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index 89a234f4c..c6d10107d 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs | |||
@@ -99,12 +99,7 @@ impl BatchDatabase { | |||
99 | let ws = ProjectWorkspace::discover(root.as_ref())?; | 99 | let ws = ProjectWorkspace::discover(root.as_ref())?; |
100 | let mut roots = Vec::new(); | 100 | let mut roots = Vec::new(); |
101 | roots.push(root.clone()); | 101 | roots.push(root.clone()); |
102 | for pkg in ws.cargo.packages() { | 102 | roots.extend(ws.to_roots()); |
103 | roots.push(pkg.root(&ws.cargo).to_path_buf()); | ||
104 | } | ||
105 | for krate in ws.sysroot.crates() { | ||
106 | roots.push(krate.root_dir(&ws.sysroot).to_path_buf()) | ||
107 | } | ||
108 | let (mut vfs, roots) = Vfs::new(roots); | 103 | let (mut vfs, roots) = Vfs::new(roots); |
109 | let mut load = |path: &Path| { | 104 | let mut load = |path: &Path| { |
110 | let vfs_file = vfs.load(path); | 105 | let vfs_file = vfs.load(path); |