From a6cdde0d0bbcb0d6617052792028eb3b258685cd Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 11 Jun 2021 01:27:20 +0300 Subject: Populate import maps eagerly --- crates/ide/src/prime_caches.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/prime_caches.rs b/crates/ide/src/prime_caches.rs index d912a01b8..36801c964 100644 --- a/crates/ide/src/prime_caches.rs +++ b/crates/ide/src/prime_caches.rs @@ -33,14 +33,15 @@ pub(crate) fn prime_caches(db: &RootDatabase, cb: &(dyn Fn(PrimeCachesProgress) // FIXME: This would be easy to parallelize, since it's in the ideal ordering for that. // Unfortunately rayon prevents panics from propagation out of a `scope`, which breaks // cancellation, so we cannot use rayon. - for (i, krate) in topo.iter().enumerate() { - let crate_name = graph[*krate].display_name.as_deref().unwrap_or_default().to_string(); + for (i, &crate_id) in topo.iter().enumerate() { + let crate_name = graph[crate_id].display_name.as_deref().unwrap_or_default().to_string(); cb(PrimeCachesProgress::StartedOnCrate { on_crate: crate_name, n_done: i, n_total: topo.len(), }); - db.crate_def_map(*krate); + db.crate_def_map(crate_id); + db.import_map(crate_id); } } -- cgit v1.2.3