mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +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
|
@ -60,7 +60,11 @@ impl BatchDatabase {
|
|||
match change {
|
||||
VfsChange::AddRoot { root, files } => {
|
||||
let source_root_id = vfs_root_to_id(root);
|
||||
log::debug!("loaded source root {:?} with path {:?}", source_root_id, vfs.root2path(root));
|
||||
log::debug!(
|
||||
"loaded source root {:?} with path {:?}",
|
||||
source_root_id,
|
||||
vfs.root2path(root)
|
||||
);
|
||||
let mut file_map = FxHashMap::default();
|
||||
for (vfs_file, path, text) in files {
|
||||
let file_id = vfs_file_to_id(vfs_file);
|
||||
|
@ -111,7 +115,8 @@ impl BatchDatabase {
|
|||
let crate_graph = ws.to_crate_graph(&mut load);
|
||||
log::debug!("crate graph: {:?}", crate_graph);
|
||||
|
||||
let local_roots = roots.into_iter()
|
||||
let local_roots = roots
|
||||
.into_iter()
|
||||
.filter(|r| vfs.root2path(*r).starts_with(&root))
|
||||
.map(vfs_root_to_id)
|
||||
.collect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue