mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Merge #10796
10796: ide: display static values in hover r=Veykril a=jhgg Continuation from #10785 - does the same thing, but for `static`'s as well. Co-authored-by: Jake Heinz <jh@discordapp.com>
This commit is contained in:
commit
bf8cf09967
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