mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
introduce Source struct
This commit is contained in:
parent
e505fe9d7b
commit
91c120ccea
6 changed files with 36 additions and 26 deletions
|
@ -136,8 +136,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
res.extend(hover_text(it.doc_comment_text(), it.short_label()))
|
||||
}
|
||||
hir::ModuleDef::Struct(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::Union(it) => {
|
||||
let it = it.source(db).1;
|
||||
|
@ -176,8 +176,11 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
if let Some((adt_def, _)) = ty.as_adt() {
|
||||
match adt_def {
|
||||
hir::AdtDef::Struct(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::AdtDef::Union(it) => {
|
||||
let it = it.source(db).1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue