Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/test-fixture/src/lib.rs')
-rw-r--r--crates/test-fixture/src/lib.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/crates/test-fixture/src/lib.rs b/crates/test-fixture/src/lib.rs
index faf9d22047..bbc109e881 100644
--- a/crates/test-fixture/src/lib.rs
+++ b/crates/test-fixture/src/lib.rs
@@ -2,8 +2,8 @@
use std::{iter, mem, str::FromStr, sync};
use base_db::{
- CrateDisplayName, CrateGraph, CrateId, CrateName, CrateOrigin, Dependency, Env, FileChange,
- FileSet, LangCrateOrigin, SourceRoot, SourceRootDatabase, Version, VfsPath,
+ CrateDisplayName, CrateGraph, CrateId, CrateName, CrateOrigin, CrateWorkspaceData, Dependency,
+ Env, FileChange, FileSet, LangCrateOrigin, SourceRoot, SourceRootDatabase, Version, VfsPath,
};
use cfg::CfgOptions;
use hir_expand::{
@@ -354,16 +354,20 @@ impl ChangeFixture {
};
roots.push(root);
- let mut change = ChangeWithProcMacros {
- source_change,
- proc_macros: Some(proc_macros.build()),
- toolchains: Some(iter::repeat(toolchain).take(crate_graph.len()).collect()),
- target_data_layouts: Some(
- iter::repeat(target_data_layout).take(crate_graph.len()).collect(),
- ),
- };
+ let mut change =
+ ChangeWithProcMacros { source_change, proc_macros: Some(proc_macros.build()) };
change.source_change.set_roots(roots);
+ change.source_change.set_ws_data(
+ crate_graph
+ .iter()
+ .zip(iter::repeat(From::from(CrateWorkspaceData {
+ proc_macro_cwd: None,
+ data_layout: target_data_layout,
+ toolchain,
+ })))
+ .collect(),
+ );
change.source_change.set_crate_graph(crate_graph);
ChangeFixture { file_position, files, change }