From bd47e140b6f6f39743d52f72437e6eaa2bfd9de1 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 4 Jan 2021 15:19:09 +0100 Subject: Show GotoTypeAction for ConstParam --- crates/hir/src/code_model.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/hir/src') 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 { pub fn parent(self, _db: &dyn HirDatabase) -> GenericDef { self.id.parent.into() } + + pub fn ty(self, db: &dyn HirDatabase) -> Type { + let def = self.id.parent; + let krate = def.module(db.upcast()).krate; + Type::new(db, krate, def, db.const_param_ty(self.id)) + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -- cgit v1.2.3