rust/crates/ra_ide_api/src/status.rs

16 lines
461 B
Rust
Raw Normal View History

2019-01-22 15:15:03 -06:00
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)
}