File tree Expand file tree Collapse file tree 2 files changed +40
-3
lines changed Expand file tree Collapse file tree 2 files changed +40
-3
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,15 @@ pub(super) fn definition(
413413 Definition :: Adt ( adt) => {
414414 adt. display_limited ( db, config. max_adt_fields_or_variants_count ) . to_string ( )
415415 }
416+ Definition :: SelfType ( impl_def) => {
417+ let self_ty = & impl_def. self_ty ( db) ;
418+ match self_ty. as_adt ( ) {
419+ Some ( adt) => {
420+ adt. display_limited ( db, config. max_adt_fields_or_variants_count ) . to_string ( )
421+ }
422+ None => self_ty. display ( db) . to_string ( ) ,
423+ }
424+ }
416425 _ => def. label ( db) ,
417426 } ;
418427 let docs = def. docs ( db, famous_defs) ;
Original file line number Diff line number Diff line change @@ -1623,6 +1623,28 @@ impl Thing {
16231623 test
16241624 ```
16251625
1626+ ```rust
1627+ struct Thing {
1628+ x: u32,
1629+ }
1630+ ```
1631+ "# ] ] ,
1632+ ) ;
1633+ check_hover_adt_fields_or_variants_limit (
1634+ None ,
1635+ r#"
1636+ struct Thing { x: u32 }
1637+ impl Thing {
1638+ fn new() -> Self { Self$0 { x: 0 } }
1639+ }
1640+ "# ,
1641+ expect ! [ [ r#"
1642+ *Self*
1643+
1644+ ```rust
1645+ test
1646+ ```
1647+
16261648 ```rust
16271649 struct Thing
16281650 ```
@@ -1643,7 +1665,9 @@ impl Thing {
16431665 ```
16441666
16451667 ```rust
1646- struct Thing
1668+ struct Thing {
1669+ x: u32,
1670+ }
16471671 ```
16481672 "# ] ] ,
16491673 ) ;
@@ -1662,7 +1686,9 @@ impl Thing {
16621686 ```
16631687
16641688 ```rust
1665- enum Thing
1689+ enum Thing {
1690+ A,
1691+ }
16661692 ```
16671693 "# ] ] ,
16681694 ) ;
@@ -1681,7 +1707,9 @@ impl Thing {
16811707 ```
16821708
16831709 ```rust
1684- enum Thing
1710+ enum Thing {
1711+ A,
1712+ }
16851713 ```
16861714 "# ] ] ,
16871715 ) ;
You can’t perform that action at this time.
0 commit comments