File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
crates/ide/src/inlay_hints Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,14 @@ pub(super) fn hints(
2222 let parent = paren. as_ref ( ) . and_then ( |it| it. parent ( ) ) . unwrap_or ( parent) ;
2323 if ast:: TypeBound :: can_cast ( parent. kind ( ) )
2424 || ast:: TypeAnchor :: can_cast ( parent. kind ( ) )
25- || ast:: Impl :: cast ( parent)
26- . and_then ( |it| it. trait_ ( ) )
27- . is_some_and ( |it| it. syntax ( ) == path. syntax ( ) )
25+ || ast:: Impl :: cast ( parent) . is_some_and ( |it| {
26+ it. trait_ ( ) . map_or (
27+ // only show it for impl type if the impl is not incomplete, otherwise we
28+ // are likely typing a trait impl
29+ it. assoc_item_list ( ) . is_none_or ( |it| it. l_curly_token ( ) . is_none ( ) ) ,
30+ |trait_| trait_. syntax ( ) == path. syntax ( ) ,
31+ )
32+ } )
2833 {
2934 return None ;
3035 }
@@ -85,6 +90,7 @@ impl T {}
8590 // ^ dyn
8691impl T for (T) {}
8792 // ^^^ dyn
93+ impl T
8894"# ,
8995 ) ;
9096 }
You can’t perform that action at this time.
0 commit comments