Set proc_macros input when creating the RootDatabase

This commit is contained in:
Lukas Wirth 2023-03-25 18:20:42 +01:00
parent 607375dc20
commit e5f24a6d7c
3 changed files with 6 additions and 2 deletions

View file

@ -64,6 +64,7 @@ impl RootDatabase {
// SourceDatabase
base_db::ParseQuery
base_db::CrateGraphQuery
base_db::ProcMacrosQuery
// SourceDatabaseExt
base_db::FileTextQuery

View file

@ -137,6 +137,7 @@ impl RootDatabase {
pub fn new(lru_capacity: Option<usize>) -> RootDatabase {
let mut db = RootDatabase { storage: ManuallyDrop::new(salsa::Storage::default()) };
db.set_crate_graph_with_durability(Default::default(), Durability::HIGH);
db.set_proc_macros_with_durability(Default::default(), Durability::HIGH);
db.set_local_roots_with_durability(Default::default(), Durability::HIGH);
db.set_library_roots_with_durability(Default::default(), Durability::HIGH);
db.set_enable_proc_attr_macros(false);

View file

@ -445,12 +445,14 @@ impl GlobalState {
let mut change = Change::new();
change.set_crate_graph(crate_graph);
self.analysis_host.apply_change(change);
self.process_changes();
if same_workspaces {
if same_workspaces && !self.fetch_workspaces_queue.op_requested() {
self.load_proc_macros(proc_macro_paths);
}
self.process_changes();
self.reload_flycheck();
tracing::info!("did switch workspaces");
}