Skip to content

Commit

Permalink
internal: allow overriding proc macro server in analysis-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbarsky committed Sep 29, 2024
1 parent 235809d commit 490df54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ impl flags::AnalysisStats {
with_proc_macro_server: if self.disable_proc_macros {
ProcMacroServerChoice::None
} else {
ProcMacroServerChoice::Sysroot
match self.proc_macro_srv {
Some(ref path) => {
let path = vfs::AbsPathBuf::assert_utf8(path.to_owned());
ProcMacroServerChoice::Explicit(path)
}
None => ProcMacroServerChoice::Sysroot,
}
},
prefill_caches: false,
};
Expand Down
7 changes: 5 additions & 2 deletions src/tools/rust-analyzer/crates/rust-analyzer/src/cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ xflags::xflags! {
optional --disable-build-scripts
/// Don't use expand proc macros.
optional --disable-proc-macros
/// Run the proc-macro-srv binary at the specified path.
optional --proc-macro-srv path: PathBuf
/// Skip body lowering.
optional --skip-lowering
/// Skip type inference.
Expand Down Expand Up @@ -120,7 +122,7 @@ xflags::xflags! {
optional --disable-build-scripts
/// Don't use expand proc macros.
optional --disable-proc-macros
/// Run a custom proc-macro-srv binary.
/// Run the proc-macro-srv binary at the specified path.
optional --proc-macro-srv path: PathBuf
}

Expand All @@ -133,7 +135,7 @@ xflags::xflags! {
optional --disable-build-scripts
/// Don't use expand proc macros.
optional --disable-proc-macros
/// Run a custom proc-macro-srv binary.
/// Run the proc-macro-srv binary at the specified path.
optional --proc-macro-srv path: PathBuf
}

Expand Down Expand Up @@ -233,6 +235,7 @@ pub struct AnalysisStats {
pub no_sysroot: bool,
pub disable_build_scripts: bool,
pub disable_proc_macros: bool,
pub proc_macro_srv: Option<PathBuf>,
pub skip_lowering: bool,
pub skip_inference: bool,
pub skip_mir_stats: bool,
Expand Down

0 comments on commit 490df54

Please sign in to comment.