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(
22
22
let parent = paren. as_ref ( ) . and_then ( |it| it. parent ( ) ) . unwrap_or ( parent) ;
23
23
if ast:: TypeBound :: can_cast ( parent. kind ( ) )
24
24
|| 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
+ } )
28
33
{
29
34
return None ;
30
35
}
@@ -85,6 +90,7 @@ impl T {}
85
90
// ^ dyn
86
91
impl T for (T) {}
87
92
// ^^^ dyn
93
+ impl T
88
94
"# ,
89
95
) ;
90
96
}
You can’t perform that action at this time.
0 commit comments