mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
use Source for statics and consts
This commit is contained in:
parent
4f94af3c4a
commit
46bc8675ed
6 changed files with 41 additions and 56 deletions
|
@ -115,8 +115,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label()))
|
||||
}
|
||||
hir::ImplItem::Const(it) => {
|
||||
let it = it.source(db).1;
|
||||
res.extend(hover_text(it.doc_comment_text(), it.short_label()))
|
||||
let src = it.source(db);
|
||||
res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label()))
|
||||
}
|
||||
hir::ImplItem::TypeAlias(it) => {
|
||||
let it = it.source(db).1;
|
||||
|
@ -152,12 +152,12 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label()))
|
||||
}
|
||||
hir::ModuleDef::Const(it) => {
|
||||
let it = it.source(db).1;
|
||||
res.extend(hover_text(it.doc_comment_text(), it.short_label()))
|
||||
let src = it.source(db);
|
||||
res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label()))
|
||||
}
|
||||
hir::ModuleDef::Static(it) => {
|
||||
let it = it.source(db).1;
|
||||
res.extend(hover_text(it.doc_comment_text(), it.short_label()))
|
||||
let src = it.source(db);
|
||||
res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label()))
|
||||
}
|
||||
hir::ModuleDef::Trait(it) => {
|
||||
let it = it.source(db).1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue