aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/source_binder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r--crates/ra_hir/src/source_binder.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index c5fdf3bab..fe4211819 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -28,8 +28,8 @@ use crate::{
28 ids::LocationCtx, 28 ids::LocationCtx,
29 resolve::{ScopeDef, TypeNs, ValueNs}, 29 resolve::{ScopeDef, TypeNs, ValueNs},
30 ty::method_resolution::{self, implements_trait}, 30 ty::method_resolution::{self, implements_trait},
31 AssocItem, Const, DefWithBody, Either, Enum, FromSource, Function, HasBody, HirFileId, Local, 31 AssocItem, Const, DefWithBody, Either, Enum, FromSource, Function, GenericParam, HasBody,
32 MacroDef, Module, Name, Path, Resolver, Static, Struct, Ty, 32 HirFileId, Local, MacroDef, Module, Name, Path, Resolver, Static, Struct, Ty,
33}; 33};
34 34
35fn try_get_resolver_for_node( 35fn try_get_resolver_for_node(
@@ -107,7 +107,7 @@ pub enum PathResolution {
107 /// A local binding (only value namespace) 107 /// A local binding (only value namespace)
108 Local(Local), 108 Local(Local),
109 /// A generic parameter 109 /// A generic parameter
110 GenericParam(u32), 110 GenericParam(GenericParam),
111 SelfType(crate::ImplBlock), 111 SelfType(crate::ImplBlock),
112 Macro(MacroDef), 112 Macro(MacroDef),
113 AssocItem(crate::AssocItem), 113 AssocItem(crate::AssocItem),
@@ -227,7 +227,10 @@ impl SourceAnalyzer {
227 ) -> Option<PathResolution> { 227 ) -> Option<PathResolution> {
228 let types = self.resolver.resolve_path_in_type_ns_fully(db, &path).map(|ty| match ty { 228 let types = self.resolver.resolve_path_in_type_ns_fully(db, &path).map(|ty| match ty {
229 TypeNs::SelfType(it) => PathResolution::SelfType(it), 229 TypeNs::SelfType(it) => PathResolution::SelfType(it),
230 TypeNs::GenericParam(it) => PathResolution::GenericParam(it), 230 TypeNs::GenericParam(idx) => PathResolution::GenericParam(GenericParam {
231 parent: self.resolver.generic_def().unwrap(),
232 idx,
233 }),
231 TypeNs::AdtSelfType(it) | TypeNs::Adt(it) => PathResolution::Def(it.into()), 234 TypeNs::AdtSelfType(it) | TypeNs::Adt(it) => PathResolution::Def(it.into()),
232 TypeNs::EnumVariant(it) => PathResolution::Def(it.into()), 235 TypeNs::EnumVariant(it) => PathResolution::Def(it.into()),
233 TypeNs::TypeAlias(it) => PathResolution::Def(it.into()), 236 TypeNs::TypeAlias(it) => PathResolution::Def(it.into()),