diff options
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 29c08e34b..278407504 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -85,9 +85,19 @@ pub enum ModuleDef { | |||
85 | Const(Const), | 85 | Const(Const), |
86 | Static(Static), | 86 | Static(Static), |
87 | Trait(Trait), | 87 | Trait(Trait), |
88 | Type(Type), | 88 | TypeAlias(TypeAlias), |
89 | } | 89 | } |
90 | impl_froms!(ModuleDef: Module, Function, Struct, Enum, EnumVariant, Const, Static, Trait, Type); | 90 | impl_froms!( |
91 | ModuleDef: Module, | ||
92 | Function, | ||
93 | Struct, | ||
94 | Enum, | ||
95 | EnumVariant, | ||
96 | Const, | ||
97 | Static, | ||
98 | Trait, | ||
99 | TypeAlias | ||
100 | ); | ||
91 | 101 | ||
92 | pub enum ModuleSource { | 102 | pub enum ModuleSource { |
93 | SourceFile(TreeArc<ast::SourceFile>), | 103 | SourceFile(TreeArc<ast::SourceFile>), |
@@ -604,11 +614,11 @@ impl Docs for Trait { | |||
604 | } | 614 | } |
605 | 615 | ||
606 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 616 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
607 | pub struct Type { | 617 | pub struct TypeAlias { |
608 | pub(crate) id: TypeId, | 618 | pub(crate) id: TypeId, |
609 | } | 619 | } |
610 | 620 | ||
611 | impl Type { | 621 | impl TypeAlias { |
612 | pub fn source(&self, db: &impl PersistentHirDatabase) -> (HirFileId, TreeArc<ast::TypeDef>) { | 622 | pub fn source(&self, db: &impl PersistentHirDatabase) -> (HirFileId, TreeArc<ast::TypeDef>) { |
613 | self.id.source(db) | 623 | self.id.source(db) |
614 | } | 624 | } |
@@ -645,7 +655,7 @@ impl Type { | |||
645 | } | 655 | } |
646 | } | 656 | } |
647 | 657 | ||
648 | impl Docs for Type { | 658 | impl Docs for TypeAlias { |
649 | fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> { | 659 | fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> { |
650 | docs_from_ast(&*self.source(db).1) | 660 | docs_from_ast(&*self.source(db).1) |
651 | } | 661 | } |