mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Show GotoTypeAction for ConstParam
This commit is contained in:
parent
cd6426afe5
commit
bd47e140b6
2 changed files with 73 additions and 38 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue