Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit e5f24a6

Browse files
committed
Set proc_macros input when creating the RootDatabase
1 parent 607375d commit e5f24a6

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

crates/ide-db/src/apply_change.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ impl RootDatabase {
6464
// SourceDatabase
6565
base_db::ParseQuery
6666
base_db::CrateGraphQuery
67+
base_db::ProcMacrosQuery
6768

6869
// SourceDatabaseExt
6970
base_db::FileTextQuery

crates/ide-db/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl RootDatabase {
137137
pub fn new(lru_capacity: Option<usize>) -> RootDatabase {
138138
let mut db = RootDatabase { storage: ManuallyDrop::new(salsa::Storage::default()) };
139139
db.set_crate_graph_with_durability(Default::default(), Durability::HIGH);
140+
db.set_proc_macros_with_durability(Default::default(), Durability::HIGH);
140141
db.set_local_roots_with_durability(Default::default(), Durability::HIGH);
141142
db.set_library_roots_with_durability(Default::default(), Durability::HIGH);
142143
db.set_enable_proc_attr_macros(false);

crates/rust-analyzer/src/reload.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,14 @@ impl GlobalState {
445445
let mut change = Change::new();
446446
change.set_crate_graph(crate_graph);
447447
self.analysis_host.apply_change(change);
448+
self.process_changes();
448449

449-
if same_workspaces {
450+
if same_workspaces && !self.fetch_workspaces_queue.op_requested() {
450451
self.load_proc_macros(proc_macro_paths);
451452
}
452-
self.process_changes();
453+
453454
self.reload_flycheck();
455+
454456
tracing::info!("did switch workspaces");
455457
}
456458

0 commit comments

Comments
 (0)