Skip to content

Commit ca9d3fb

Browse files
committed
Delay initial cache priming until proc-macros are loaded
1 parent a3910c6 commit ca9d3fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/rust-analyzer/src/main_loop.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,11 @@ impl GlobalState {
452452
// Project has loaded properly, kick off initial flycheck
453453
self.flycheck.iter().for_each(|flycheck| flycheck.restart_workspace(None));
454454
}
455-
if self.config.prefill_caches() {
455+
// delay initial cache priming until proc macros are loaded, or we will load up a bunch of garbage into salsa
456+
let proc_macros_loaded = self.config.prefill_caches()
457+
&& !self.config.expand_proc_macros()
458+
|| self.fetch_proc_macros_queue.last_op_result().copied().unwrap_or(false);
459+
if proc_macros_loaded {
456460
self.prime_caches_queue.request_op("became quiescent".to_owned(), ());
457461
}
458462
}

0 commit comments

Comments
 (0)