diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-02 22:04:08 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-02 22:04:08 +0100 |
commit | f15f0d1ec006c6c628fb70414d311bd85c2a0469 (patch) | |
tree | 635e47b1796a224917e38899549d8ce04d9755cf /crates/ra_hir | |
parent | dd698fc3f7090b7781504566a8b82cf2c3d62420 (diff) | |
parent | 546442df68bcb62e7ff4bc7356c6a003052304da (diff) |
Merge #1472
1472: Add completion for type aliases r=matklad a=sinkuu
Co-authored-by: Shotaro Yamada <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-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 | } |