File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed
crates/ide-completion/src/completions/item_list Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,13 @@ fn get_transformed_fn(
344344 }
345345 _ => None ,
346346 } ) ?;
347- ted:: replace ( ty. syntax ( ) , output. syntax ( ) ) ;
347+ if let ast:: Type :: TupleType ( ty) = & output
348+ && ty. fields ( ) . next ( ) . is_none ( )
349+ {
350+ ted:: remove ( fn_. ret_type ( ) ?. syntax ( ) ) ;
351+ } else {
352+ ted:: replace ( ty. syntax ( ) , output. syntax ( ) ) ;
353+ }
348354 }
349355 _ => ( ) ,
350356 }
@@ -1617,6 +1623,35 @@ impl DesugaredAsyncTrait for () {
16171623 $0
16181624}
16191625}
1626+ "# ,
1627+ ) ;
1628+
1629+ check_edit (
1630+ "async fn foo" ,
1631+ r#"
1632+ //- minicore: future, send, sized
1633+ use core::future::Future;
1634+
1635+ trait DesugaredAsyncTrait {
1636+ fn foo(&self) -> impl Future<Output = ()> + Send;
1637+ }
1638+
1639+ impl DesugaredAsyncTrait for () {
1640+ $0
1641+ }
1642+ "# ,
1643+ r#"
1644+ use core::future::Future;
1645+
1646+ trait DesugaredAsyncTrait {
1647+ fn foo(&self) -> impl Future<Output = ()> + Send;
1648+ }
1649+
1650+ impl DesugaredAsyncTrait for () {
1651+ async fn foo(&self) {
1652+ $0
1653+ }
1654+ }
16201655"# ,
16211656 ) ;
16221657 }
You can’t perform that action at this time.
0 commit comments