rust/crates/ra_ide_api/src/status.rs

16 lines
423 B
Rust
Raw Normal View History

2019-01-22 15:15:03 -06:00
use ra_db::{
2019-01-24 03:41:08 -06:00
SourceFileQuery,
2019-01-22 15:15:03 -06:00
salsa::{Database, debug::DebugQueryTable},
};
use crate::db::RootDatabase;
pub(crate) fn status(db: &RootDatabase) -> String {
2019-01-25 06:16:50 -06:00
let n_parsed_files = db.query(SourceFileQuery).entries::<Vec<_>>().len();
2019-01-22 15:15:03 -06:00
let n_defs = {
2019-01-24 03:41:08 -06:00
let interner: &hir::HirInterner = db.as_ref();
2019-01-22 15:15:03 -06:00
interner.len()
};
format!("#n_parsed_files {}\n#n_defs {}\n", n_parsed_files, n_defs)
}