File tree 2 files changed +10
-1
lines changed
crates/rust-analyzer/src/cli
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,15 @@ impl flags::Diagnostics {
17
17
pub fn run ( self ) -> anyhow:: Result < ( ) > {
18
18
let mut cargo_config = CargoConfig :: default ( ) ;
19
19
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
+ } ;
20
26
let load_cargo_config = LoadCargoConfig {
21
27
load_out_dirs_from_check : !self . disable_build_scripts ,
22
- with_proc_macro_server : ProcMacroServerChoice :: Sysroot ,
28
+ with_proc_macro_server,
23
29
prefill_caches : false ,
24
30
} ;
25
31
let ( host, _vfs, _proc_macro) =
Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ xflags::xflags! {
92
92
optional --disable-build-scripts
93
93
/// Don't use expand proc macros.
94
94
optional --disable-proc-macros
95
+ /// Run a custom proc-macro-srv binary.
96
+ optional --proc-macro-srv path: PathBuf
95
97
}
96
98
97
99
cmd ssr {
@@ -189,6 +191,7 @@ pub struct Diagnostics {
189
191
190
192
pub disable_build_scripts : bool ,
191
193
pub disable_proc_macros : bool ,
194
+ pub proc_macro_srv : Option < PathBuf > ,
192
195
}
193
196
194
197
#[ derive( Debug ) ]
You can’t perform that action at this time.
0 commit comments