Fix completion and hover for module and function of same name

This commit is contained in:
Hasan Ali 2020-05-15 22:23:49 +01:00
parent cffa70be01
commit 001a86dc03
4 changed files with 102 additions and 2 deletions

View file

@ -23,7 +23,7 @@ use crate::{
db::HirDatabase,
diagnostics::Diagnostic,
semantics::source_to_def::{ChildContainer, SourceToDefCache, SourceToDefCtx},
source_analyzer::{resolve_hir_path, SourceAnalyzer},
source_analyzer::{resolve_hir_path, resolve_hir_path_qualifier, SourceAnalyzer},
AssocItem, Field, Function, HirFileId, ImplDef, InFile, Local, MacroDef, Module, ModuleDef,
Name, Origin, Path, ScopeDef, Trait, Type, TypeAlias, TypeParam,
};
@ -451,6 +451,10 @@ impl<'a, DB: HirDatabase> SemanticsScope<'a, DB> {
pub fn resolve_hir_path(&self, path: &Path) -> Option<PathResolution> {
resolve_hir_path(self.db, &self.resolver, path)
}
pub fn resolve_hir_path_qualifier(&self, path: &Path) -> Option<PathResolution> {
resolve_hir_path_qualifier(self.db, &self.resolver, path)
}
}
// FIXME: Change `HasSource` trait to work with `Semantics` and remove this?