mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
fix: the fields or variants of ADT was not restricted by limitations when hovering on Self type
This commit is contained in:
parent
01c3559bf3
commit
c06d670f8f
2 changed files with 40 additions and 3 deletions
|
@ -413,6 +413,15 @@ pub(super) fn definition(
|
|||
Definition::Adt(adt) => {
|
||||
adt.display_limited(db, config.max_adt_fields_or_variants_count).to_string()
|
||||
}
|
||||
Definition::SelfType(impl_def) => {
|
||||
let self_ty = &impl_def.self_ty(db);
|
||||
match self_ty.as_adt() {
|
||||
Some(adt) => {
|
||||
adt.display_limited(db, config.max_adt_fields_or_variants_count).to_string()
|
||||
}
|
||||
None => self_ty.display(db).to_string(),
|
||||
}
|
||||
}
|
||||
_ => def.label(db),
|
||||
};
|
||||
let docs = def.docs(db, famous_defs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue