aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-05 10:32:40 +0100
committerGitHub <[email protected]>2021-06-05 10:32:40 +0100
commit15fe4e42bb158191c836920ae6b17edf9eed99bd (patch)
treebc0dd257efc90452a63e6a61f2957570c31450c3
parentd647568db161db585f4f2ee3af9160e445338ac1 (diff)
parentd174b919dcd091e258738b476b93a26b0a4b12e2 (diff)
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 <[email protected]>
-rw-r--r--crates/rust-analyzer/src/cli/load_cargo.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs
index 75bad1112..8cee65478 100644
--- a/crates/rust-analyzer/src/cli/load_cargo.rs
+++ b/crates/rust-analyzer/src/cli/load_cargo.rs
@@ -4,6 +4,7 @@ use std::{path::Path, sync::Arc};
4 4
5use anyhow::Result; 5use anyhow::Result;
6use crossbeam_channel::{unbounded, Receiver}; 6use crossbeam_channel::{unbounded, Receiver};
7use hir::db::DefDatabase;
7use ide::{AnalysisHost, Change}; 8use ide::{AnalysisHost, Change};
8use ide_db::base_db::CrateGraph; 9use ide_db::base_db::CrateGraph;
9use project_model::{ 10use project_model::{
@@ -94,6 +95,8 @@ fn load_crate_graph(
94 let mut host = AnalysisHost::new(lru_cap); 95 let mut host = AnalysisHost::new(lru_cap);
95 let mut analysis_change = Change::new(); 96 let mut analysis_change = Change::new();
96 97
98 host.raw_database_mut().set_enable_proc_attr_macros(true);
99
97 // wait until Vfs has loaded all roots 100 // wait until Vfs has loaded all roots
98 for task in receiver { 101 for task in receiver {
99 match task { 102 match task {