mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
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.
This commit is contained in:
parent
b1a1d20e06
commit
00d927a188
9 changed files with 309 additions and 96 deletions
|
@ -99,12 +99,7 @@ impl BatchDatabase {
|
|||
let ws = ProjectWorkspace::discover(root.as_ref())?;
|
||||
let mut roots = Vec::new();
|
||||
roots.push(root.clone());
|
||||
for pkg in ws.cargo.packages() {
|
||||
roots.push(pkg.root(&ws.cargo).to_path_buf());
|
||||
}
|
||||
for krate in ws.sysroot.crates() {
|
||||
roots.push(krate.root_dir(&ws.sysroot).to_path_buf())
|
||||
}
|
||||
ws.add_roots(&mut roots);
|
||||
let (mut vfs, roots) = Vfs::new(roots);
|
||||
let mut load = |path: &Path| {
|
||||
let vfs_file = vfs.load(path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue