aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/status.rs
blob: 5c14cbdeb4a1ee295e1c6b5537187442b845cef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use ra_db::{
    SourceFileQuery,
    salsa::{Database, debug::DebugQueryTable},
};

use crate::db::RootDatabase;

pub(crate) fn status(db: &RootDatabase) -> String {
    let n_parsed_files = db.query(SourceFileQuery).keys::<Vec<_>>().len();
    let n_defs = {
        let interner: &hir::HirInterner = db.as_ref();
        interner.len()
    };
    format!("#n_parsed_files {}\n#n_defs {}\n", n_parsed_files, n_defs)
}