mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
ide: display static values in hover
This commit is contained in:
parent
64a73dcfba
commit
e8d0989606
3 changed files with 30 additions and 20 deletions
|
@ -1497,6 +1497,10 @@ impl Static {
|
|||
db.static_data(self.id).mutable
|
||||
}
|
||||
|
||||
pub fn value(self, db: &dyn HirDatabase) -> Option<ast::Expr> {
|
||||
self.source(db)?.value.body()
|
||||
}
|
||||
|
||||
pub fn ty(self, db: &dyn HirDatabase) -> Type {
|
||||
let data = db.static_data(self.id);
|
||||
let resolver = self.id.resolver(db.upcast());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue