switched to lowerd module

This commit is contained in:
Aleksey Kladov 2019-01-18 16:36:56 +03:00
parent b93c6bc557
commit c0aeb5204c
9 changed files with 284 additions and 65 deletions

View file

@ -7,7 +7,7 @@ use ra_syntax::{ast, TreeArc, SyntaxNode};
use crate::{
Name, DefId, Path, PerNs, ScopesWithSyntaxMapping, Ty, HirFileId,
type_ref::TypeRef,
nameres::ModuleScope,
nameres::{ModuleScope, lower::LoweredImport},
db::HirDatabase,
expr::BodySyntaxMapping,
ty::InferenceResult,
@ -96,6 +96,15 @@ impl Module {
self.declaration_source_impl(db)
}
/// Returns the syntax of the last path segment corresponding to this import
pub fn import_source(
&self,
db: &impl HirDatabase,
import: LoweredImport,
) -> TreeArc<ast::PathSegment> {
self.import_source_impl(db, import)
}
/// Returns the crate this module is part of.
pub fn krate(&self, db: &impl HirDatabase) -> Option<Crate> {
self.krate_impl(db)