Skip to content

Commit 490df54

Browse files
committed
internal: allow overriding proc macro server in analysis-stats
1 parent 235809d commit 490df54

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ impl flags::AnalysisStats {
8181
with_proc_macro_server:ifself.disable_proc_macros{
8282
ProcMacroServerChoice::None
8383
}else{
84-
ProcMacroServerChoice::Sysroot
84+
matchself.proc_macro_srv{
85+
Some(ref path) => {
86+
let path = vfs::AbsPathBuf::assert_utf8(path.to_owned());
87+
ProcMacroServerChoice::Explicit(path)
88+
}
89+
None => ProcMacroServerChoice::Sysroot,
90+
}
8591
},
8692
prefill_caches:false,
8793
};

‎src/tools/rust-analyzer/crates/rust-analyzer/src/cli/flags.rs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ xflags::xflags! {
7676
optional --disable-build-scripts
7777
/// Don't use expand proc macros.
7878
optional --disable-proc-macros
79+
/// Run the proc-macro-srv binary at the specified path.
80+
optional --proc-macro-srv path:PathBuf
7981
/// Skip body lowering.
8082
optional --skip-lowering
8183
/// Skip type inference.
@@ -120,7 +122,7 @@ xflags::xflags! {
120122
optional --disable-build-scripts
121123
/// Don't use expand proc macros.
122124
optional --disable-proc-macros
123-
/// Run a custom proc-macro-srv binary.
125+
/// Run the proc-macro-srv binary at the specified path.
124126
optional --proc-macro-srv path:PathBuf
125127
}
126128

@@ -133,7 +135,7 @@ xflags::xflags! {
133135
optional --disable-build-scripts
134136
/// Don't use expand proc macros.
135137
optional --disable-proc-macros
136-
/// Run a custom proc-macro-srv binary.
138+
/// Run the proc-macro-srv binary at the specified path.
137139
optional --proc-macro-srv path:PathBuf
138140
}
139141

@@ -233,6 +235,7 @@ pub struct AnalysisStats {
233235
pubno_sysroot:bool,
234236
pubdisable_build_scripts:bool,
235237
pubdisable_proc_macros:bool,
238+
pubproc_macro_srv:Option<PathBuf>,
236239
pubskip_lowering:bool,
237240
pubskip_inference:bool,
238241
pubskip_mir_stats:bool,

0 commit comments

Comments
 (0)