diff options
Diffstat (limited to 'crates/ra_batch')
-rw-r--r-- | crates/ra_batch/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_batch/src/lib.rs | 18 |
2 files changed, 9 insertions, 11 deletions
diff --git a/crates/ra_batch/Cargo.toml b/crates/ra_batch/Cargo.toml index 62850746f..c85da7a2c 100644 --- a/crates/ra_batch/Cargo.toml +++ b/crates/ra_batch/Cargo.toml | |||
@@ -9,7 +9,7 @@ log = "0.4.5" | |||
9 | rustc-hash = "1.0" | 9 | rustc-hash = "1.0" |
10 | crossbeam-channel = "0.3.5" | 10 | crossbeam-channel = "0.3.5" |
11 | 11 | ||
12 | ra_vfs = "0.4.0" | 12 | ra_vfs = "0.5.0" |
13 | ra_vfs_glob = { path = "../ra_vfs_glob" } | 13 | ra_vfs_glob = { path = "../ra_vfs_glob" } |
14 | ra_db = { path = "../ra_db" } | 14 | ra_db = { path = "../ra_db" } |
15 | ra_ide_api = { path = "../ra_ide_api" } | 15 | ra_ide_api = { path = "../ra_ide_api" } |
diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index a5fc2a23e..df49eb13d 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs | |||
@@ -43,8 +43,12 @@ pub fn load_cargo(root: &Path) -> Result<(AnalysisHost, FxHashMap<SourceRootId, | |||
43 | ); | 43 | ); |
44 | 44 | ||
45 | // FIXME: cfg options? | 45 | // FIXME: cfg options? |
46 | let default_cfg_options = | 46 | let default_cfg_options = { |
47 | get_rustc_cfg_options().atom("test".into()).atom("debug_assertion".into()); | 47 | let mut opts = get_rustc_cfg_options(); |
48 | opts.insert_atom("test".into()); | ||
49 | opts.insert_atom("debug_assertion".into()); | ||
50 | opts | ||
51 | }; | ||
48 | 52 | ||
49 | let (crate_graph, _crate_names) = | 53 | let (crate_graph, _crate_names) = |
50 | ws.to_crate_graph(&default_cfg_options, &mut |path: &Path| { | 54 | ws.to_crate_graph(&default_cfg_options, &mut |path: &Path| { |
@@ -137,14 +141,8 @@ mod tests { | |||
137 | #[test] | 141 | #[test] |
138 | fn test_loading_rust_analyzer() { | 142 | fn test_loading_rust_analyzer() { |
139 | let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap(); | 143 | let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap(); |
140 | let (host, roots) = load_cargo(path).unwrap(); | 144 | let (host, _roots) = load_cargo(path).unwrap(); |
141 | let mut n_crates = 0; | 145 | let n_crates = Crate::all(host.raw_database()).len(); |
142 | for (root, _) in roots { | ||
143 | for _krate in Crate::source_root_crates(host.raw_database(), root) { | ||
144 | n_crates += 1; | ||
145 | } | ||
146 | } | ||
147 | |||
148 | // RA has quite a few crates, but the exact count doesn't matter | 146 | // RA has quite a few crates, but the exact count doesn't matter |
149 | assert!(n_crates > 20); | 147 | assert!(n_crates > 20); |
150 | } | 148 | } |