File tree 3 files changed +10
-1
lines changed
crates/rust-analyzer/src/cli
3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ impl flags::AnalysisStats {
63
63
true => None ,
64
64
false => Some ( RustLibSource :: Discover ) ,
65
65
} ;
66
+ cargo_config. sysroot_query_metadata = self . query_sysroot_metadata ;
66
67
let no_progress = & |_| ( ) ;
67
68
68
69
let mut db_load_sw = self . stop_watch ( ) ;
Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ xflags::xflags! {
71
71
optional --with-deps
72
72
/// Don't load sysroot crates (`std`, `core` & friends).
73
73
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
74
77
75
78
/// Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.
76
79
optional --disable-build-scripts
@@ -206,6 +209,7 @@ pub struct AnalysisStats {
206
209
pub only : Option < String > ,
207
210
pub with_deps : bool ,
208
211
pub no_sysroot : bool ,
212
+ pub query_sysroot_metadata : bool ,
209
213
pub disable_build_scripts : bool ,
210
214
pub disable_proc_macros : bool ,
211
215
pub skip_lowering : bool ,
Original file line number Diff line number Diff line change @@ -113,7 +113,11 @@ impl Metrics {
113
113
) -> anyhow:: Result < ( ) > {
114
114
assert ! ( Path :: new( path) . exists( ) , "unable to find bench in {path}" ) ;
115
115
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 ( ) ?;
117
121
for ( metric, value, unit) in parse_metrics ( & output) {
118
122
self . report ( & format ! ( "analysis-stats/{name}/{metric}" ) , value, unit. into ( ) ) ;
119
123
}
You can’t perform that action at this time.
0 commit comments