mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
add parent & resolve_path
This commit is contained in:
parent
1836f4db35
commit
3c2cb89087
4 changed files with 67 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
use ra_db::{CrateId, Cancelable, FileId};
|
||||
use ra_syntax::ast;
|
||||
|
||||
use crate::{Name, db::HirDatabase, DefId};
|
||||
use crate::{Name, db::HirDatabase, DefId, Path, PerNs};
|
||||
|
||||
/// hir::Crate describes a single crate. It's the main inteface with which
|
||||
/// crate's dependencies interact. Mostly, it should be just a proxy for the
|
||||
|
@ -52,4 +52,12 @@ impl Module {
|
|||
pub fn child(&self, db: &impl HirDatabase, name: &Name) -> Cancelable<Option<Module>> {
|
||||
self.child_impl(db, name)
|
||||
}
|
||||
/// Finds a parent module.
|
||||
pub fn parent(&self, db: &impl HirDatabase) -> Cancelable<Option<Module>> {
|
||||
self.parent_impl(db)
|
||||
}
|
||||
|
||||
pub fn resolve_path(&self, db: &impl HirDatabase, path: &Path) -> Cancelable<PerNs<DefId>> {
|
||||
self.resolve_path_impl(db, path)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue