Show GotoTypeAction for ConstParam

This commit is contained in:
Lukas Wirth 2021-01-04 15:19:09 +01:00
parent cd6426afe5
commit bd47e140b6
2 changed files with 73 additions and 38 deletions

View file

@ -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)]