Support loading OUT_DIR from cargo check at launch

This commit is contained in:
Emil Lauridsen
2020-03-16 13:43:29 +01:00
parent 2720e2374b
commit 33c6c7abc6
10 changed files with 242 additions and 108 deletions

View File

@@ -54,12 +54,18 @@ pub(crate) fn load_cargo(
// FIXME: outdirs?
let outdirs = FxHashMap::default();
let extern_source_roots = FxHashMap::default();
let crate_graph = ws.to_crate_graph(&default_cfg_options, &outdirs, &mut |path: &Path| {
let vfs_file = vfs.load(path);
log::debug!("vfs file {:?} -> {:?}", path, vfs_file);
vfs_file.map(vfs_file_to_id)
});
let crate_graph = ws.to_crate_graph(
&default_cfg_options,
&outdirs,
&extern_source_roots,
&mut |path: &Path| {
let vfs_file = vfs.load(path);
log::debug!("vfs file {:?} -> {:?}", path, vfs_file);
vfs_file.map(vfs_file_to_id)
},
);
log::debug!("crate graph: {:?}", crate_graph);
let source_roots = roots