You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xcode 11.5 with the latest 5.3 toolchain offers the completions shown in the attached screenshot:
The full function definition, with all parameters, which completes well (though there should be more combinations available).
The second, which appears to suggest only the non-defaulted closure argument.
Accepting the second suggestion inserts the following:
session.withAllRequests{(<#Request#>)in<#code#>}
Due to the parameter the compiler considers this invalid, as the single closure syntax is only compatible with the last closure. The only way to enter the non-defaulted closure by itself is with the full function syntax.
Tagging @benlangmuir since he appeared to be working on the autocomplete during the review thread.
The text was updated successfully, but these errors were encountered:
This also appears to apply if I try to complete just the action closure after deleting the other parameters. It completes into single trailing closure syntax, which is incorrect.
This is caused by the separation between code-completion and placeholder expansion. When we go to expand the placeholder there is no syntactic reason we cannot produce a trailing closure.
Attachment: Download
Environment
Swift 5.3 toolchain from 5/19, Xcode 11.5.
Additional Detail from JIRA
md5: 17f28578e5367659b43e96dc75a4fa99
Issue Description:
New API is being built for Alamofire involving multiple closures, so it was designed with multiple trailing closure syntax in mind.
Xcode 11.5 with the latest 5.3 toolchain offers the completions shown in the attached screenshot:
The full function definition, with all parameters, which completes well (though there should be more combinations available).
The second, which appears to suggest only the non-defaulted closure argument.
Accepting the second suggestion inserts the following:
Due to the parameter the compiler considers this invalid, as the single closure syntax is only compatible with the last closure. The only way to enter the non-defaulted closure by itself is with the full function syntax.
Tagging @benlangmuir since he appeared to be working on the autocomplete during the review thread.
The text was updated successfully, but these errors were encountered: