mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
diagnostics cli, iterate over members
This commit is contained in:
parent
f9701efbe7
commit
6be972770e
2 changed files with 27 additions and 19 deletions
|
@ -25,7 +25,7 @@ use hir_ty::{
|
|||
autoderef, display::HirFormatter, expr::ExprValidator, method_resolution, ApplicationTy,
|
||||
Canonical, InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor,
|
||||
};
|
||||
use ra_db::{CrateId, Edition, FileId};
|
||||
use ra_db::{CrateId, CrateName, Edition, FileId};
|
||||
use ra_prof::profile;
|
||||
use ra_syntax::{
|
||||
ast::{self, AttrsOwner, NameOwner},
|
||||
|
@ -91,6 +91,10 @@ impl Crate {
|
|||
db.crate_graph()[self.id].edition
|
||||
}
|
||||
|
||||
pub fn display_name(self, db: &dyn HirDatabase) -> Option<CrateName> {
|
||||
db.crate_graph()[self.id].display_name.as_ref().cloned()
|
||||
}
|
||||
|
||||
pub fn all(db: &dyn HirDatabase) -> Vec<Crate> {
|
||||
db.crate_graph().iter().map(|id| Crate { id }).collect()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue