File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
crates/rust-analyzer/src/cli Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ impl flags::AnalysisStats {
6363 true => None ,
6464 false => Some ( RustLibSource :: Discover ) ,
6565 } ;
66+ cargo_config. sysroot_query_metadata = self . query_sysroot_metadata ;
6667 let no_progress = & |_| ( ) ;
6768
6869 let mut db_load_sw = self . stop_watch ( ) ;
Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ xflags::xflags! {
7171 optional --with-deps
7272 /// Don't load sysroot crates (`std`, `core` & friends).
7373 optional --no-sysroot
74+ /// Run cargo metadata on the sysroot to analyze its third-pary dependencies.
75+ /// Requires --no-sysroot to not be set.
76+ optional --query-sysroot-metadata
7477
7578 /// Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.
7679 optional --disable-build-scripts
@@ -206,6 +209,7 @@ pub struct AnalysisStats {
206209 pub only : Option < String > ,
207210 pub with_deps : bool ,
208211 pub no_sysroot : bool ,
212+ pub query_sysroot_metadata : bool ,
209213 pub disable_build_scripts : bool ,
210214 pub disable_proc_macros : bool ,
211215 pub skip_lowering : bool ,
Original file line number Diff line number Diff line change @@ -113,7 +113,11 @@ impl Metrics {
113113 ) -> anyhow:: Result < ( ) > {
114114 assert ! ( Path :: new( path) . exists( ) , "unable to find bench in {path}" ) ;
115115 eprintln ! ( "\n Measuring analysis-stats/{name}" ) ;
116- let output = cmd ! ( sh, "./target/release/rust-analyzer -q analysis-stats {path}" ) . read ( ) ?;
116+ let output = cmd ! (
117+ sh,
118+ "./target/release/rust-analyzer -q analysis-stats {path} --query-sysroot-metadata"
119+ )
120+ . read ( ) ?;
117121 for ( metric, value, unit) in parse_metrics ( & output) {
118122 self . report ( & format ! ( "analysis-stats/{name}/{metric}" ) , value, unit. into ( ) ) ;
119123 }
You can’t perform that action at this time.
0 commit comments