mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
use Source for Function
This commit is contained in:
parent
36865adcb9
commit
4f94af3c4a
10 changed files with 30 additions and 28 deletions
|
@ -96,8 +96,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
|
||||
match classify_name_ref(db, &analyzer, name_ref) {
|
||||
Some(Method(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()));
|
||||
}
|
||||
Some(Macro(it)) => {
|
||||
let it = it.source(db).1;
|
||||
|
@ -111,8 +111,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
}
|
||||
Some(AssocItem(it)) => match it {
|
||||
hir::ImplItem::Method(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::Const(it) => {
|
||||
let it = it.source(db).1;
|
||||
|
@ -132,8 +132,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
}
|
||||
}
|
||||
hir::ModuleDef::Function(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::Struct(it) => {
|
||||
let src = it.source(db);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue