aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/status.rs
blob: d3e04be230c233d12d972111bd250a3fd5ab3cc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use ra_db::{
    LocationIntener, 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: &LocationIntener<hir::DefLoc, hir::DefId> = db.as_ref();
        interner.len()
    };
    format!("#n_parsed_files {}\n#n_defs {}\n", n_parsed_files, n_defs)
}