@@ -228,17 +228,20 @@ fn hint_iterator(
228
228
_ => None ,
229
229
} ) ?;
230
230
if let Some ( ty) = ty. normalize_trait_assoc_type ( db, iter_trait, & [ ] , assoc_type_item) {
231
- // TODO kb also check for the iterator impls for this ty
232
- dbg ! ( ty. display( db) . to_string( ) ) ;
233
231
const LABEL_START : & str = "impl Iterator<Item = " ;
234
232
const LABEL_END : & str = ">" ;
235
233
236
- let ty_display = ty. display_truncated (
237
- db,
238
- config
239
- . max_length
240
- . map ( |len| len. saturating_sub ( LABEL_START . len ( ) + LABEL_END . len ( ) ) ) ,
241
- ) ;
234
+ let ty_display = hint_iterator ( sema, config, & ty)
235
+ . map ( |assoc_type_impl| assoc_type_impl. to_string ( ) )
236
+ . unwrap_or_else ( || {
237
+ ty. display_truncated (
238
+ db,
239
+ config
240
+ . max_length
241
+ . map ( |len| len. saturating_sub ( LABEL_START . len ( ) + LABEL_END . len ( ) ) ) ,
242
+ )
243
+ . to_string ( )
244
+ } ) ;
242
245
return Some ( format ! ( "{}{}{}" , LABEL_START , ty_display, LABEL_END ) . into ( ) ) ;
243
246
}
244
247
}
@@ -1169,7 +1172,7 @@ fn main() {
1169
1172
InlayHintsConfig {
1170
1173
parameter_hints : false ,
1171
1174
type_hints : true ,
1172
- chaining_hints : true ,
1175
+ chaining_hints : false ,
1173
1176
max_length : None ,
1174
1177
} ,
1175
1178
r#"
@@ -1193,8 +1196,8 @@ fn main() {
1193
1196
let mut some_iter = SomeIter::new();
1194
1197
//^^^^^^^^^^^^^ SomeIter<Take<Repeat<i32>>>
1195
1198
some_iter.push(iter::repeat(2).take(2));
1196
- let zz = some_iter.take(2);
1197
- //^^ impl Iterator<Item = Take<Repeat< i32> >>
1199
+ let iter_of_iters = some_iter.take(2);
1200
+ //^^^^^^^^^^^^^ impl Iterator<Item = impl Iterator<Item = i32>>
1198
1201
}
1199
1202
"# ,
1200
1203
) ;
0 commit comments