File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
crates/rust-analyzer/src/cli Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,8 @@ xflags::xflags! {
150150 optional --disable-proc-macros
151151 /// Run the proc-macro-srv binary at the specified path.
152152 optional --proc-macro-srv path: PathBuf
153- /// Run cache priming in parallel .
154- optional --parallel
153+ /// The number of threads to use. Defaults to the number of physical cores .
154+ optional --num-threads num_threads : usize
155155 }
156156
157157 cmd ssr {
@@ -299,7 +299,7 @@ pub struct PrimeCaches {
299299 pub disable_build_scripts : bool ,
300300 pub disable_proc_macros : bool ,
301301 pub proc_macro_srv : Option < PathBuf > ,
302- pub parallel : bool ,
302+ pub num_threads : Option < usize > ,
303303}
304304
305305#[ derive( Debug ) ]
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ impl flags::PrimeCaches {
5252 elapsed. memory. allocated. megabytes( ) as u64
5353 ) ;
5454
55- let threads = if self . parallel { num_cpus:: get ( ) } else { 1 } ;
55+ let threads = self . num_threads . unwrap_or_else ( num_cpus:: get_physical ) ;
5656 ide_db:: prime_caches:: parallel_prime_caches ( & db, threads, & |_| ( ) ) ;
5757
5858 let elapsed = stop_watch. elapsed ( ) ;
You can’t perform that action at this time.
0 commit comments