diff options
author | Shotaro Yamada <[email protected]> | 2019-07-02 19:08:39 +0100 |
---|---|---|
committer | Shotaro Yamada <[email protected]> | 2019-07-02 19:08:39 +0100 |
commit | 546442df68bcb62e7ff4bc7356c6a003052304da (patch) | |
tree | 635e47b1796a224917e38899549d8ce04d9755cf /crates/ra_hir/src | |
parent | dd698fc3f7090b7781504566a8b82cf2c3d62420 (diff) |
Add completion for type aliases
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 32f98e394..75914ccb0 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -849,6 +849,10 @@ impl TypeAlias { | |||
849 | db.type_alias_data(self).type_ref.clone() | 849 | db.type_alias_data(self).type_ref.clone() |
850 | } | 850 | } |
851 | 851 | ||
852 | pub fn ty(self, db: &impl HirDatabase) -> Ty { | ||
853 | db.type_for_def(self.into(), Namespace::Types) | ||
854 | } | ||
855 | |||
852 | pub fn name(self, db: &impl DefDatabase) -> Name { | 856 | pub fn name(self, db: &impl DefDatabase) -> Name { |
853 | db.type_alias_data(self).name.clone() | 857 | db.type_alias_data(self).name.clone() |
854 | } | 858 | } |