Skip to content

Commit 15fe4e4

Browse files
Merge #9145
9145: internal: Enable attribute macro expansion in `analysis-stats` r=flodiebold a=flodiebold Before: ``` > $ rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs . Database loaded: 19.08s, 277minstr crates: 34, mods: 688, decls: 13202, fns: 10412 Item Collection: 16.21s, 76ginstr exprs: 290580, ??ty: 2508 (0%), ?ty: 1814 (0%), !ty: 947 Inference: 27.46s, 108ginstr Total: 43.67s, 184ginstr ``` After: ``` > $ ./target/release/rust-analyzer -q analysis-stats --with-proc-macro --load-output-dirs . Database loaded: 1.09s, 277minstr crates: 34, mods: 688, decls: 14790, fns: 11006 Item Collection: 18.20s, 78ginstr exprs: 297826, ??ty: 493 (0%), ?ty: 558 (0%), !ty: 342 Inference: 28.34s, 111ginstr Total: 46.54s, 190ginstr ``` Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 parents d647568 + d174b91 commit 15fe4e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/rust-analyzer/src/cli/load_cargo.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::{path::Path, sync::Arc};
44

55
use anyhow::Result;
66
use crossbeam_channel::{unbounded, Receiver};
7+
use hir::db::DefDatabase;
78
use ide::{AnalysisHost, Change};
89
use ide_db::base_db::CrateGraph;
910
use project_model::{
@@ -94,6 +95,8 @@ fn load_crate_graph(
9495
let mut host = AnalysisHost::new(lru_cap);
9596
let mut analysis_change = Change::new();
9697

98+
host.raw_database_mut().set_enable_proc_attr_macros(true);
99+
97100
// wait until Vfs has loaded all roots
98101
for task in receiver {
99102
match task {

0 commit comments

Comments
 (0)