mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
fix tests
This commit is contained in:
parent
8c4d277036
commit
61687b9db6
4 changed files with 43 additions and 21 deletions
|
@ -1,4 +1,5 @@
|
|||
use ra_db::{CrateId, Cancelable};
|
||||
use ra_db::{CrateId, Cancelable, FileId};
|
||||
use ra_syntax::ast;
|
||||
|
||||
use crate::{Name, db::HirDatabase, DefId};
|
||||
|
||||
|
@ -17,6 +18,9 @@ pub struct CrateDependency {
|
|||
}
|
||||
|
||||
impl Crate {
|
||||
pub fn crate_id(&self) -> CrateId {
|
||||
self.crate_id
|
||||
}
|
||||
pub fn dependencies(&self, db: &impl HirDatabase) -> Vec<CrateDependency> {
|
||||
self.dependencies_impl(db)
|
||||
}
|
||||
|
@ -31,6 +35,10 @@ pub struct Module {
|
|||
}
|
||||
|
||||
impl Module {
|
||||
pub fn source(&self, db: &impl HirDatabase) -> (FileId, Option<ast::ModuleNode>) {
|
||||
self.source_impl(db)
|
||||
}
|
||||
|
||||
/// Returns the crate this module is part of.
|
||||
pub fn krate(&self, db: &impl HirDatabase) -> Cancelable<Option<Crate>> {
|
||||
self.krate_impl(db)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue