mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
internal: Set Durability to HIGH for enable_proc_attr_macros input
This commit is contained in:
parent
5390949c11
commit
e244942209
11 changed files with 33 additions and 28 deletions
|
@ -4,7 +4,6 @@ use std::{convert::identity, path::Path, sync::Arc};
|
|||
|
||||
use anyhow::Result;
|
||||
use crossbeam_channel::{unbounded, Receiver};
|
||||
use hir::db::DefDatabase;
|
||||
use ide::{AnalysisHost, Change};
|
||||
use ide_db::{
|
||||
base_db::{CrateGraph, ProcMacros},
|
||||
|
@ -143,7 +142,7 @@ fn load_crate_graph(
|
|||
let mut host = AnalysisHost::new(lru_cap);
|
||||
let mut analysis_change = Change::new();
|
||||
|
||||
host.raw_database_mut().set_enable_proc_attr_macros(true);
|
||||
host.raw_database_mut().enable_proc_attr_macros();
|
||||
|
||||
// wait until Vfs has loaded all roots
|
||||
for task in receiver {
|
||||
|
|
|
@ -19,8 +19,8 @@ use hir::db::DefDatabase;
|
|||
use ide::Change;
|
||||
use ide_db::{
|
||||
base_db::{
|
||||
CrateGraph, Env, ProcMacro, ProcMacroExpander, ProcMacroExpansionError, ProcMacroKind,
|
||||
ProcMacroLoadResult, ProcMacroPaths, ProcMacros, SourceRoot, VfsPath,
|
||||
salsa::Durability, CrateGraph, Env, ProcMacro, ProcMacroExpander, ProcMacroExpansionError,
|
||||
ProcMacroKind, ProcMacroLoadResult, ProcMacroPaths, ProcMacros, SourceRoot, VfsPath,
|
||||
},
|
||||
FxHashMap,
|
||||
};
|
||||
|
@ -88,12 +88,13 @@ impl GlobalState {
|
|||
self.reload_flycheck();
|
||||
}
|
||||
|
||||
if self.analysis_host.raw_database().enable_proc_attr_macros()
|
||||
if self.analysis_host.raw_database().expand_proc_attr_macros()
|
||||
!= self.config.expand_proc_attr_macros()
|
||||
{
|
||||
self.analysis_host
|
||||
.raw_database_mut()
|
||||
.set_enable_proc_attr_macros(self.config.expand_proc_attr_macros());
|
||||
self.analysis_host.raw_database_mut().set_expand_proc_attr_macros_with_durability(
|
||||
self.config.expand_proc_attr_macros(),
|
||||
Durability::HIGH,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue