diff options
author | Aleksey Kladov <[email protected]> | 2019-11-20 14:39:58 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-20 14:43:03 +0000 |
commit | 64c21ed19594b323e72605ba8c5dd4c6eee433f6 (patch) | |
tree | 6b48928149607fa6396357af29abfb4eb3d4d791 /crates/ra_hir_def/src/nameres/collector.rs | |
parent | b7a36b54431ca5b746af53549a1b6e142570c7f4 (diff) |
Switch type aliases to new sources
Diffstat (limited to 'crates/ra_hir_def/src/nameres/collector.rs')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index d2ed94a87..060185b61 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -21,7 +21,7 @@ use crate::{ | |||
21 | path::{Path, PathKind}, | 21 | path::{Path, PathKind}, |
22 | AdtId, AstId, AstItemDef, ConstId, CrateModuleId, EnumId, EnumVariantId, FunctionContainerId, | 22 | AdtId, AstId, AstItemDef, ConstId, CrateModuleId, EnumId, EnumVariantId, FunctionContainerId, |
23 | FunctionLoc, ImplId, Intern, LocationCtx, ModuleDefId, ModuleId, StaticId, StructId, | 23 | FunctionLoc, ImplId, Intern, LocationCtx, ModuleDefId, ModuleId, StaticId, StructId, |
24 | StructOrUnionId, TraitId, TypeAliasId, UnionId, | 24 | StructOrUnionId, TraitId, TypeAliasContainerId, TypeAliasLoc, UnionId, |
25 | }; | 25 | }; |
26 | 26 | ||
27 | pub(super) fn collect_defs(db: &impl DefDatabase2, mut def_map: CrateDefMap) -> CrateDefMap { | 27 | pub(super) fn collect_defs(db: &impl DefDatabase2, mut def_map: CrateDefMap) -> CrateDefMap { |
@@ -673,13 +673,13 @@ where | |||
673 | let name = def.name.clone(); | 673 | let name = def.name.clone(); |
674 | let def: PerNs = match def.kind { | 674 | let def: PerNs = match def.kind { |
675 | raw::DefKind::Function(ast_id) => { | 675 | raw::DefKind::Function(ast_id) => { |
676 | let f = FunctionLoc { | 676 | let def = FunctionLoc { |
677 | container: FunctionContainerId::ModuleId(module), | 677 | container: FunctionContainerId::ModuleId(module), |
678 | ast_id: AstId::new(self.file_id, ast_id), | 678 | ast_id: AstId::new(self.file_id, ast_id), |
679 | } | 679 | } |
680 | .intern(self.def_collector.db); | 680 | .intern(self.def_collector.db); |
681 | 681 | ||
682 | PerNs::values(f.into()) | 682 | PerNs::values(def.into()) |
683 | } | 683 | } |
684 | raw::DefKind::Struct(ast_id) => { | 684 | raw::DefKind::Struct(ast_id) => { |
685 | let id = StructOrUnionId::from_ast_id(ctx, ast_id).into(); | 685 | let id = StructOrUnionId::from_ast_id(ctx, ast_id).into(); |
@@ -698,7 +698,13 @@ where | |||
698 | } | 698 | } |
699 | raw::DefKind::Trait(ast_id) => PerNs::types(TraitId::from_ast_id(ctx, ast_id).into()), | 699 | raw::DefKind::Trait(ast_id) => PerNs::types(TraitId::from_ast_id(ctx, ast_id).into()), |
700 | raw::DefKind::TypeAlias(ast_id) => { | 700 | raw::DefKind::TypeAlias(ast_id) => { |
701 | PerNs::types(TypeAliasId::from_ast_id(ctx, ast_id).into()) | 701 | let def = TypeAliasLoc { |
702 | container: TypeAliasContainerId::ModuleId(module), | ||
703 | ast_id: AstId::new(self.file_id, ast_id), | ||
704 | } | ||
705 | .intern(self.def_collector.db); | ||
706 | |||
707 | PerNs::types(def.into()) | ||
702 | } | 708 | } |
703 | }; | 709 | }; |
704 | let resolution = Resolution { def, import: None }; | 710 | let resolution = Resolution { def, import: None }; |