Skip to content

Commit 887dd4e

Browse files
committed
Make procMacro_* workspace
1 parent 7360dfe commit 887dd4e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ config_data! {
119119
/// Sets the LRU capacity of the specified queries.
120120
lru_query_capacities: FxHashMap<Box<str>, u16> = FxHashMap::default(),
121121

122-
/// These proc-macros will be ignored when trying to expand them.
123-
///
124-
/// This config takes a map of crate names with the exported proc-macro names to ignore as values.
125-
procMacro_ignored: FxHashMap<Box<str>, Box<[Box<str>]>> = FxHashMap::default(),
126122

127123

128124
/// Enables automatic discovery of projects using [`DiscoverWorkspaceConfig::command`].
@@ -409,6 +405,11 @@ config_data! {
409405
/// If false, `-p <package>` will be passed instead.
410406
check_workspace: bool = true,
411407

408+
/// These proc-macros will be ignored when trying to expand them.
409+
///
410+
/// This config takes a map of crate names with the exported proc-macro names to ignore as values.
411+
procMacro_ignored: FxHashMap<Box<str>, Box<[Box<str>]>> = FxHashMap::default(),
412+
412413
/// Command to be executed instead of 'cargo' for runnables.
413414
runnables_command: Option<String> = None,
414415
/// Additional arguments to be passed to cargo for runnables such as
@@ -1764,8 +1765,11 @@ impl Config {
17641765
Some(AbsPathBuf::try_from(path).unwrap_or_else(|path| self.root_path.join(path)))
17651766
}
17661767

1767-
pub fn ignored_proc_macros(&self) -> &FxHashMap<Box<str>, Box<[Box<str>]>> {
1768-
self.procMacro_ignored()
1768+
pub fn ignored_proc_macros(
1769+
&self,
1770+
source_root: Option<SourceRootId>,
1771+
) -> &FxHashMap<Box<str>, Box<[Box<str>]>> {
1772+
self.procMacro_ignored(source_root)
17691773
}
17701774

17711775
pub fn expand_proc_macros(&self) -> bool {

src/tools/rust-analyzer/crates/rust-analyzer/src/reload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ impl GlobalState {
382382

383383
pub(crate) fn fetch_proc_macros(&mut self, cause: Cause, paths: Vec<ProcMacroPaths>) {
384384
info!(%cause, "will load proc macros");
385-
let ignored_proc_macros = self.config.ignored_proc_macros().clone();
385+
let ignored_proc_macros = self.config.ignored_proc_macros(None).clone();
386386
let proc_macro_clients = self.proc_macro_clients.clone();
387387

388388
self.task_pool.handle.spawn_with_sender(ThreadIntent::Worker, move |sender| {

0 commit comments

Comments
 (0)