File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
crates/rust-analyzer/src/cli Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,15 @@ impl flags::Diagnostics {
1717 pub fn run ( self ) -> anyhow:: Result < ( ) > {
1818 let mut cargo_config = CargoConfig :: default ( ) ;
1919 cargo_config. sysroot = Some ( RustLibSource :: Discover ) ;
20+ let with_proc_macro_server = if let Some ( p) = & self . proc_macro_srv {
21+ let path = vfs:: AbsPathBuf :: assert ( std:: env:: current_dir ( ) ?. join ( & p) ) ;
22+ ProcMacroServerChoice :: Explicit ( path)
23+ } else {
24+ ProcMacroServerChoice :: Sysroot
25+ } ;
2026 let load_cargo_config = LoadCargoConfig {
2127 load_out_dirs_from_check : !self . disable_build_scripts ,
22- with_proc_macro_server : ProcMacroServerChoice :: Sysroot ,
28+ with_proc_macro_server,
2329 prefill_caches : false ,
2430 } ;
2531 let ( host, _vfs, _proc_macro) =
Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ xflags::xflags! {
9292 optional --disable-build-scripts
9393 /// Don't use expand proc macros.
9494 optional --disable-proc-macros
95+ /// Run a custom proc-macro-srv binary.
96+ optional --proc-macro-srv path: PathBuf
9597 }
9698
9799 cmd ssr {
@@ -189,6 +191,7 @@ pub struct Diagnostics {
189191
190192 pub disable_build_scripts : bool ,
191193 pub disable_proc_macros : bool ,
194+ pub proc_macro_srv : Option < PathBuf > ,
192195}
193196
194197#[ derive( Debug ) ]
You can’t perform that action at this time.
0 commit comments