diff options
Diffstat (limited to 'crates/ra_ide/src/mock_analysis.rs')
-rw-r--r-- | crates/ra_ide/src/mock_analysis.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs index f4cd6deb7..25816cf6f 100644 --- a/crates/ra_ide/src/mock_analysis.rs +++ b/crates/ra_ide/src/mock_analysis.rs | |||
@@ -99,13 +99,21 @@ impl MockAnalysis { | |||
99 | root_crate = Some(crate_graph.add_crate_root( | 99 | root_crate = Some(crate_graph.add_crate_root( |
100 | file_id, | 100 | file_id, |
101 | Edition2018, | 101 | Edition2018, |
102 | None, | ||
102 | cfg_options, | 103 | cfg_options, |
103 | Env::default(), | 104 | Env::default(), |
105 | Default::default(), | ||
104 | )); | 106 | )); |
105 | } else if path.ends_with("/lib.rs") { | 107 | } else if path.ends_with("/lib.rs") { |
106 | let other_crate = | ||
107 | crate_graph.add_crate_root(file_id, Edition2018, cfg_options, Env::default()); | ||
108 | let crate_name = path.parent().unwrap().file_name().unwrap(); | 108 | let crate_name = path.parent().unwrap().file_name().unwrap(); |
109 | let other_crate = crate_graph.add_crate_root( | ||
110 | file_id, | ||
111 | Edition2018, | ||
112 | Some(crate_name.to_owned()), | ||
113 | cfg_options, | ||
114 | Env::default(), | ||
115 | Default::default(), | ||
116 | ); | ||
109 | if let Some(root_crate) = root_crate { | 117 | if let Some(root_crate) = root_crate { |
110 | crate_graph | 118 | crate_graph |
111 | .add_dep(root_crate, CrateName::new(crate_name).unwrap(), other_crate) | 119 | .add_dep(root_crate, CrateName::new(crate_name).unwrap(), other_crate) |