mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Add an ra_cli command that analyses all crates in the current workspace
... and prints various stats about how many expressions have a type etc.
This commit is contained in:
parent
43e52ac9e2
commit
6964a88e8c
9 changed files with 227 additions and 4 deletions
|
@ -112,6 +112,7 @@ impl CrateGraph {
|
|||
self.arena[&crate_id].file_id
|
||||
}
|
||||
|
||||
// TODO: this only finds one crate with the given root; we could have multiple
|
||||
pub fn crate_id_for_crate_root(&self, file_id: FileId) -> Option<CrateId> {
|
||||
let (&crate_id, _) = self.arena.iter().find(|(_crate_id, data)| data.file_id == file_id)?;
|
||||
Some(crate_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue