diff options
Diffstat (limited to 'crates/ra_ide_api/src/parent_module.rs')
-rw-r--r-- | crates/ra_ide_api/src/parent_module.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/parent_module.rs b/crates/ra_ide_api/src/parent_module.rs index fa232a379..6027e7d54 100644 --- a/crates/ra_ide_api/src/parent_module.rs +++ b/crates/ra_ide_api/src/parent_module.rs | |||
@@ -34,12 +34,14 @@ pub(crate) fn crate_for(db: &RootDatabase, file_id: FileId) -> Vec<CrateId> { | |||
34 | 34 | ||
35 | #[cfg(test)] | 35 | #[cfg(test)] |
36 | mod tests { | 36 | mod tests { |
37 | use ra_cfg::CfgOptions; | ||
38 | use ra_db::Env; | ||
39 | |||
37 | use crate::{ | 40 | use crate::{ |
38 | mock_analysis::{analysis_and_position, MockAnalysis}, | 41 | mock_analysis::{analysis_and_position, MockAnalysis}, |
39 | AnalysisChange, CrateGraph, | 42 | AnalysisChange, CrateGraph, |
40 | Edition::Edition2018, | 43 | Edition::Edition2018, |
41 | }; | 44 | }; |
42 | use ra_cfg::CfgOptions; | ||
43 | 45 | ||
44 | #[test] | 46 | #[test] |
45 | fn test_resolve_parent_module() { | 47 | fn test_resolve_parent_module() { |
@@ -87,7 +89,12 @@ mod tests { | |||
87 | assert!(host.analysis().crate_for(mod_file).unwrap().is_empty()); | 89 | assert!(host.analysis().crate_for(mod_file).unwrap().is_empty()); |
88 | 90 | ||
89 | let mut crate_graph = CrateGraph::default(); | 91 | let mut crate_graph = CrateGraph::default(); |
90 | let crate_id = crate_graph.add_crate_root(root_file, Edition2018, CfgOptions::default()); | 92 | let crate_id = crate_graph.add_crate_root( |
93 | root_file, | ||
94 | Edition2018, | ||
95 | CfgOptions::default(), | ||
96 | Env::default(), | ||
97 | ); | ||
91 | let mut change = AnalysisChange::new(); | 98 | let mut change = AnalysisChange::new(); |
92 | change.set_crate_graph(crate_graph); | 99 | change.set_crate_graph(crate_graph); |
93 | host.apply_change(change); | 100 | host.apply_change(change); |