diff options
author | Florian Diebold <[email protected]> | 2019-02-09 17:27:11 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-02-10 09:56:58 +0000 |
commit | 6964a88e8c90f06220498d3e9194b7e2073c1e32 (patch) | |
tree | a3f8e225118c810d5c2784d64b559e3e05e6b6db /crates/ra_batch | |
parent | 43e52ac9e2b26ec287b1778823bad10851cfd44e (diff) |
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.
Diffstat (limited to 'crates/ra_batch')
-rw-r--r-- | crates/ra_batch/src/lib.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index ea91d88b7..014663546 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs | |||
@@ -60,7 +60,11 @@ impl BatchDatabase { | |||
60 | match change { | 60 | match change { |
61 | VfsChange::AddRoot { root, files } => { | 61 | VfsChange::AddRoot { root, files } => { |
62 | let source_root_id = vfs_root_to_id(root); | 62 | let source_root_id = vfs_root_to_id(root); |
63 | log::debug!("loaded source root {:?} with path {:?}", source_root_id, vfs.root2path(root)); | 63 | log::debug!( |
64 | "loaded source root {:?} with path {:?}", | ||
65 | source_root_id, | ||
66 | vfs.root2path(root) | ||
67 | ); | ||
64 | let mut file_map = FxHashMap::default(); | 68 | let mut file_map = FxHashMap::default(); |
65 | for (vfs_file, path, text) in files { | 69 | for (vfs_file, path, text) in files { |
66 | let file_id = vfs_file_to_id(vfs_file); | 70 | let file_id = vfs_file_to_id(vfs_file); |
@@ -111,7 +115,8 @@ impl BatchDatabase { | |||
111 | let crate_graph = ws.to_crate_graph(&mut load); | 115 | let crate_graph = ws.to_crate_graph(&mut load); |
112 | log::debug!("crate graph: {:?}", crate_graph); | 116 | log::debug!("crate graph: {:?}", crate_graph); |
113 | 117 | ||
114 | let local_roots = roots.into_iter() | 118 | let local_roots = roots |
119 | .into_iter() | ||
115 | .filter(|r| vfs.root2path(*r).starts_with(&root)) | 120 | .filter(|r| vfs.root2path(*r).starts_with(&root)) |
116 | .map(vfs_root_to_id) | 121 | .map(vfs_root_to_id) |
117 | .collect(); | 122 | .collect(); |