File tree Expand file tree Collapse file tree
crates/ide-completion/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -828,10 +828,15 @@ fn expected_type_and_name<'db>(
828828 . unwrap_or( ( None , None ) )
829829 } ,
830830 ast:: Variant ( it) => {
831+ let is_simple_field = |field: ast:: TupleField | {
832+ let Some ( ty) = field. ty( ) else { return true } ;
833+ matches!( ty, ast:: Type :: PathType ( _) ) && ty. generic_arg_list( ) . is_none( )
834+ } ;
831835 let is_simple_variant = matches!(
832836 it. field_list( ) ,
833837 Some ( ast:: FieldList :: TupleFieldList ( list) )
834838 if list. syntax( ) . children_with_tokens( ) . all( |it| it. kind( ) != T ![ , ] )
839+ && list. fields( ) . next( ) . is_none_or( is_simple_field)
835840 ) ;
836841 ( None , it. name( ) . filter( |_| is_simple_variant) . map( NameOrNameRef :: Name ) )
837842 } ,
Original file line number Diff line number Diff line change @@ -3077,6 +3077,22 @@ enum Foo {
30773077 st String String []
30783078 "# ] ] ,
30793079 ) ;
3080+
3081+ check_relevance (
3082+ r#"
3083+ struct Other;
3084+ struct Vec<T>(T);
3085+ enum Foo {
3086+ Vec(Vec<$0>)
3087+ }
3088+ "# ,
3089+ expect ! [ [ r#"
3090+ en Foo Foo []
3091+ st Other Other []
3092+ sp Self Foo []
3093+ st Vec<…> Vec<{unknown}> []
3094+ "# ] ] ,
3095+ ) ;
30803096 }
30813097
30823098 #[ test]
You can’t perform that action at this time.
0 commit comments