aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-02 22:04:08 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-02 22:04:08 +0100
commitf15f0d1ec006c6c628fb70414d311bd85c2a0469 (patch)
tree635e47b1796a224917e38899549d8ce04d9755cf /crates/ra_hir
parentdd698fc3f7090b7781504566a8b82cf2c3d62420 (diff)
parent546442df68bcb62e7ff4bc7356c6a003052304da (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.rs4
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 }