diff options
author | Lukas Wirth <[email protected]> | 2021-01-04 14:19:09 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-01-04 14:19:09 +0000 |
commit | bd47e140b6f6f39743d52f72437e6eaa2bfd9de1 (patch) | |
tree | d28417cc2832a5d3126cb43b3b9800f2afb4aed1 /crates/hir/src | |
parent | cd6426afe5daaeb90c4398669bcae03a6c353658 (diff) |
Show GotoTypeAction for ConstParam
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/code_model.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index a2255508e..a7a38d43a 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -1343,6 +1343,12 @@ impl ConstParam { | |||
1343 | pub fn parent(self, _db: &dyn HirDatabase) -> GenericDef { | 1343 | pub fn parent(self, _db: &dyn HirDatabase) -> GenericDef { |
1344 | self.id.parent.into() | 1344 | self.id.parent.into() |
1345 | } | 1345 | } |
1346 | |||
1347 | pub fn ty(self, db: &dyn HirDatabase) -> Type { | ||
1348 | let def = self.id.parent; | ||
1349 | let krate = def.module(db.upcast()).krate; | ||
1350 | Type::new(db, krate, def, db.const_param_ty(self.id)) | ||
1351 | } | ||
1346 | } | 1352 | } |
1347 | 1353 | ||
1348 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 1354 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |