Commit 32ceb24
committed
[Refactoring] Promote call to refactored completion handlers to
When a function’s completion handler is being passed to another function and the function that the completion handler is being declared in is converted to async, replace the call to the completion handler by a `return` statement.
For example:
```swift
func foo(completion: (String) -> Void) {
bar(completion)
}
```
becomes
```swift
func foo() async -> String {
return await bar()
}
```
Previously, we were calling the completion handler, which no longer exists in the newly created `async` function.return
1 parent 921443e commit 32ceb24
File tree
2 files changed
+176
-3
lines changed- lib/IDE
- test/refactoring/ConvertAsync
2 files changed
+176
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4367 | 4367 | | |
4368 | 4368 | | |
4369 | 4369 | | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
4370 | 4375 | | |
4371 | 4376 | | |
4372 | 4377 | | |
| |||
4944 | 4949 | | |
4945 | 4950 | | |
4946 | 4951 | | |
| 4952 | + | |
4947 | 4953 | | |
4948 | 4954 | | |
4949 | 4955 | | |
| |||
5292 | 5298 | | |
5293 | 5299 | | |
5294 | 5300 | | |
| 5301 | + | |
| 5302 | + | |
| 5303 | + | |
| 5304 | + | |
| 5305 | + | |
| 5306 | + | |
| 5307 | + | |
| 5308 | + | |
| 5309 | + | |
| 5310 | + | |
| 5311 | + | |
| 5312 | + | |
| 5313 | + | |
| 5314 | + | |
| 5315 | + | |
| 5316 | + | |
5295 | 5317 | | |
5296 | 5318 | | |
5297 | 5319 | | |
| |||
5448 | 5470 | | |
5449 | 5471 | | |
5450 | 5472 | | |
5451 | | - | |
| 5473 | + | |
5452 | 5474 | | |
5453 | 5475 | | |
5454 | 5476 | | |
| |||
5458 | 5480 | | |
5459 | 5481 | | |
5460 | 5482 | | |
5461 | | - | |
5462 | 5483 | | |
5463 | 5484 | | |
5464 | 5485 | | |
| |||
0 commit comments