mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
ad status command
This commit is contained in:
parent
e08df3219d
commit
0ba7e2eaeb
10 changed files with 68 additions and 0 deletions
15
crates/ra_ide_api/src/status.rs
Normal file
15
crates/ra_ide_api/src/status.rs
Normal file
|
@ -0,0 +1,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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue