diff options
author | Aleksey Kladov <[email protected]> | 2018-12-28 18:06:08 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-28 18:07:47 +0000 |
commit | 11122e29b7ec5bc2e08822deaa6fdf9a1cc8ffca (patch) | |
tree | 741ad2441092616b8bd4e30a865eae9e1ea6d5c7 /crates/ra_hir/src | |
parent | 1a860dba38225a4d3e122eaf49c926479826becf (diff) |
completion for enum variants
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/adt.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_hir/src/adt.rs b/crates/ra_hir/src/adt.rs index 65c461148..6cdaa1888 100644 --- a/crates/ra_hir/src/adt.rs +++ b/crates/ra_hir/src/adt.rs | |||
@@ -73,6 +73,10 @@ impl Enum { | |||
73 | pub fn name(&self, db: &impl HirDatabase) -> Cancelable<Option<SmolStr>> { | 73 | pub fn name(&self, db: &impl HirDatabase) -> Cancelable<Option<SmolStr>> { |
74 | Ok(db.enum_data(self.def_id)?.name.clone()) | 74 | Ok(db.enum_data(self.def_id)?.name.clone()) |
75 | } | 75 | } |
76 | |||
77 | pub fn variants(&self, db: &impl HirDatabase) -> Cancelable<Vec<(SmolStr, Arc<VariantData>)>> { | ||
78 | Ok(db.enum_data(self.def_id)?.variants.clone()) | ||
79 | } | ||
76 | } | 80 | } |
77 | 81 | ||
78 | #[derive(Debug, Clone, PartialEq, Eq)] | 82 | #[derive(Debug, Clone, PartialEq, Eq)] |