@@ -2558,7 +2558,7 @@ fn main() { let s$0t = foo(); }
2558
2558
focus_range: 6..9,
2559
2559
name: "Foo",
2560
2560
kind: Trait,
2561
- description: "trait Foo",
2561
+ description: "trait Foo {} ",
2562
2562
},
2563
2563
},
2564
2564
],
@@ -2592,7 +2592,7 @@ fn main() { let s$0t = foo(); }
2592
2592
focus_range: 6..9,
2593
2593
name: "Foo",
2594
2594
kind: Trait,
2595
- description: "trait Foo<T>",
2595
+ description: "trait Foo<T> {} ",
2596
2596
},
2597
2597
},
2598
2598
HoverGotoTypeData {
@@ -2639,7 +2639,7 @@ fn main() { let s$0t = foo(); }
2639
2639
focus_range: 6..9,
2640
2640
name: "Foo",
2641
2641
kind: Trait,
2642
- description: "trait Foo",
2642
+ description: "trait Foo {} ",
2643
2643
},
2644
2644
},
2645
2645
HoverGotoTypeData {
@@ -2652,7 +2652,7 @@ fn main() { let s$0t = foo(); }
2652
2652
focus_range: 19..22,
2653
2653
name: "Bar",
2654
2654
kind: Trait,
2655
- description: "trait Bar",
2655
+ description: "trait Bar {} ",
2656
2656
},
2657
2657
},
2658
2658
],
@@ -2689,7 +2689,7 @@ fn main() { let s$0t = foo(); }
2689
2689
focus_range: 6..9,
2690
2690
name: "Foo",
2691
2691
kind: Trait,
2692
- description: "trait Foo<T>",
2692
+ description: "trait Foo<T> {} ",
2693
2693
},
2694
2694
},
2695
2695
HoverGotoTypeData {
@@ -2702,7 +2702,7 @@ fn main() { let s$0t = foo(); }
2702
2702
focus_range: 22..25,
2703
2703
name: "Bar",
2704
2704
kind: Trait,
2705
- description: "trait Bar<T>",
2705
+ description: "trait Bar<T> {} ",
2706
2706
},
2707
2707
},
2708
2708
HoverGotoTypeData {
@@ -2759,7 +2759,7 @@ fn foo(ar$0g: &impl Foo) {}
2759
2759
focus_range: 6..9,
2760
2760
name: "Foo",
2761
2761
kind: Trait,
2762
- description: "trait Foo",
2762
+ description: "trait Foo {} ",
2763
2763
},
2764
2764
},
2765
2765
],
@@ -2793,7 +2793,7 @@ fn foo(ar$0g: &impl Foo + Bar<S>) {}
2793
2793
focus_range: 6..9,
2794
2794
name: "Foo",
2795
2795
kind: Trait,
2796
- description: "trait Foo",
2796
+ description: "trait Foo {} ",
2797
2797
},
2798
2798
},
2799
2799
HoverGotoTypeData {
@@ -2806,7 +2806,7 @@ fn foo(ar$0g: &impl Foo + Bar<S>) {}
2806
2806
focus_range: 19..22,
2807
2807
name: "Bar",
2808
2808
kind: Trait,
2809
- description: "trait Bar<T>",
2809
+ description: "trait Bar<T> {} ",
2810
2810
},
2811
2811
},
2812
2812
HoverGotoTypeData {
@@ -2861,7 +2861,7 @@ pub mod future {
2861
2861
name: "Future",
2862
2862
kind: Trait,
2863
2863
container_name: "future",
2864
- description: "pub trait Future",
2864
+ description: "pub trait Future {} ",
2865
2865
},
2866
2866
},
2867
2867
HoverGotoTypeData {
@@ -2906,7 +2906,7 @@ fn foo(ar$0g: &impl Foo<S>) {}
2906
2906
focus_range: 6..9,
2907
2907
name: "Foo",
2908
2908
kind: Trait,
2909
- description: "trait Foo<T>",
2909
+ description: "trait Foo<T> {} ",
2910
2910
},
2911
2911
},
2912
2912
HoverGotoTypeData {
@@ -2969,7 +2969,7 @@ fn main() { let s$0t = foo(); }
2969
2969
focus_range: 6..9,
2970
2970
name: "Foo",
2971
2971
kind: Trait,
2972
- description: "trait Foo",
2972
+ description: "trait Foo {} ",
2973
2973
},
2974
2974
},
2975
2975
],
@@ -3000,7 +3000,7 @@ fn foo(ar$0g: &dyn Foo) {}
3000
3000
focus_range: 6..9,
3001
3001
name: "Foo",
3002
3002
kind: Trait,
3003
- description: "trait Foo",
3003
+ description: "trait Foo {} ",
3004
3004
},
3005
3005
},
3006
3006
],
@@ -3032,7 +3032,7 @@ fn foo(ar$0g: &dyn Foo<S>) {}
3032
3032
focus_range: 6..9,
3033
3033
name: "Foo",
3034
3034
kind: Trait,
3035
- description: "trait Foo<T>",
3035
+ description: "trait Foo<T> {} ",
3036
3036
},
3037
3037
},
3038
3038
HoverGotoTypeData {
@@ -3080,7 +3080,7 @@ fn foo(a$0rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {}
3080
3080
focus_range: 6..15,
3081
3081
name: "ImplTrait",
3082
3082
kind: Trait,
3083
- description: "trait ImplTrait<T>",
3083
+ description: "trait ImplTrait<T> {} ",
3084
3084
},
3085
3085
},
3086
3086
HoverGotoTypeData {
@@ -3106,7 +3106,7 @@ fn foo(a$0rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {}
3106
3106
focus_range: 28..36,
3107
3107
name: "DynTrait",
3108
3108
kind: Trait,
3109
- description: "trait DynTrait<T>",
3109
+ description: "trait DynTrait<T> {} ",
3110
3110
},
3111
3111
},
3112
3112
HoverGotoTypeData {
@@ -3161,7 +3161,7 @@ fn main() { let s$0t = test().get(); }
3161
3161
focus_range: 6..9,
3162
3162
name: "Foo",
3163
3163
kind: Trait,
3164
- description: "trait Foo",
3164
+ description: "trait Foo {\n type Item,\n fn get(self) -> Self::Item,\n} ",
3165
3165
},
3166
3166
},
3167
3167
],
@@ -3226,7 +3226,7 @@ fn foo<T: Foo>(t: T$0){}
3226
3226
focus_range: 6..9,
3227
3227
name: "Foo",
3228
3228
kind: Trait,
3229
- description: "trait Foo",
3229
+ description: "trait Foo {} ",
3230
3230
},
3231
3231
},
3232
3232
],
@@ -6103,6 +6103,99 @@ impl T for () {
6103
6103
) ;
6104
6104
}
6105
6105
6106
+ #[ test]
6107
+ fn hover_trait_show_assoc_items ( ) {
6108
+ check (
6109
+ r#"
6110
+ trait T {}
6111
+ impl T$0 for () {}
6112
+ "# ,
6113
+ expect ! [ [ r#"
6114
+ *T*
6115
+
6116
+ ```rust
6117
+ test
6118
+ ```
6119
+
6120
+ ```rust
6121
+ trait T {}
6122
+ ```
6123
+ "# ] ] ,
6124
+ ) ;
6125
+
6126
+ check (
6127
+ r#"
6128
+ trait T {
6129
+ fn func() {}
6130
+ }
6131
+ impl T$0 for () {}
6132
+ "# ,
6133
+ expect ! [ [ r#"
6134
+ *T*
6135
+
6136
+ ```rust
6137
+ test
6138
+ ```
6139
+
6140
+ ```rust
6141
+ trait T {
6142
+ fn func(),
6143
+ }
6144
+ ```
6145
+ "# ] ] ,
6146
+ ) ;
6147
+
6148
+ check (
6149
+ r#"
6150
+ trait T {
6151
+ fn func() {}
6152
+ const FLAG: i32 = 34;
6153
+ }
6154
+ impl T$0 for () {}
6155
+ "# ,
6156
+ expect ! [ [ r#"
6157
+ *T*
6158
+
6159
+ ```rust
6160
+ test
6161
+ ```
6162
+
6163
+ ```rust
6164
+ trait T {
6165
+ fn func(),
6166
+ const FLAG: i32,
6167
+ }
6168
+ ```
6169
+ "# ] ] ,
6170
+ ) ;
6171
+
6172
+ check (
6173
+ r#"
6174
+ trait T {
6175
+ fn func() {}
6176
+ const FLAG: i32 = 34;
6177
+ type Bar;
6178
+ }
6179
+ impl T$0 for () {}
6180
+ "# ,
6181
+ expect ! [ [ r#"
6182
+ *T*
6183
+
6184
+ ```rust
6185
+ test
6186
+ ```
6187
+
6188
+ ```rust
6189
+ trait T {
6190
+ fn func(),
6191
+ const FLAG: i32,
6192
+ type Bar,
6193
+ }
6194
+ ```
6195
+ "# ] ] ,
6196
+ ) ;
6197
+ }
6198
+
6106
6199
#[ test]
6107
6200
fn hover_ranged_macro_call ( ) {
6108
6201
check_hover_range (
0 commit comments