From f94215c99b846a9657185390a0b943da48f83738 Mon Sep 17 00:00:00 2001 From: Jonathan Keller Date: Fri, 24 Apr 2026 16:42:25 -0700 Subject: [PATCH] Repartition source roots after running build scripts --- crates/rust-analyzer/src/reload.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 1832275eb38d..fba9d3994d1e 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs @@ -732,6 +732,10 @@ impl GlobalState { self.source_root_config = project_folders.source_root_config; self.local_roots_parent_map = Arc::new(self.source_root_config.source_root_parent_map()); + let mut change = ChangeWithProcMacros::default(); + change.set_roots(self.source_root_config.partition(&self.vfs.read().0)); + self.analysis_host.apply_change(change); + info!(?cause, "recreating the crate graph"); self.recreate_crate_graph(cause, switching_from_empty_workspace);