mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
switched to lowerd module
This commit is contained in:
parent
b93c6bc557
commit
c0aeb5204c
9 changed files with 284 additions and 65 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue