mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +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
|
@ -70,6 +70,14 @@ impl Body {
|
|||
self.owner
|
||||
}
|
||||
|
||||
pub fn exprs(&self) -> impl Iterator<Item = (ExprId, &Expr)> {
|
||||
self.exprs.iter()
|
||||
}
|
||||
|
||||
pub fn pats(&self) -> impl Iterator<Item = (PatId, &Pat)> {
|
||||
self.pats.iter()
|
||||
}
|
||||
|
||||
pub fn syntax_mapping(&self, db: &impl HirDatabase) -> Arc<BodySyntaxMapping> {
|
||||
db.body_syntax_mapping(self.owner)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue