always produce source for import

This commit is contained in:
Aleksey Kladov 2019-04-02 17:58:04 +03:00
parent 0a758a2c48
commit 0de89f786f
6 changed files with 70 additions and 29 deletions

View file

@ -4,7 +4,7 @@ use ra_db::{CrateId, SourceRootId, Edition};
use ra_syntax::{ast::self, TreeArc};
use crate::{
Name, ScopesWithSourceMap, Ty, HirFileId,
Name, ScopesWithSourceMap, Ty, HirFileId, ImportSource,
HirDatabase, DefDatabase,
type_ref::TypeRef,
nameres::{ModuleScope, Namespace, ImportId, CrateModuleId},
@ -117,7 +117,7 @@ impl Module {
}
/// Returns the syntax of the last path segment corresponding to this import
pub fn import_source(&self, db: &impl HirDatabase, import: ImportId) -> TreeArc<ast::UseTree> {
pub fn import_source(&self, db: &impl HirDatabase, import: ImportId) -> ImportSource {
self.import_source_impl(db, import)
}