Quick Help in Xcode does not show type information for closure params, but does for usages of the param within the closure body.
Affected Xcode versions: This has been the case since Swift was released AFAIK, I never remember it working, but definitely Xcode 10, 11 & 12.
Example:
let_: (Int) -> Void = { numin// <- option-clicking 'num' here does not show type infoprint(num) // <- option-clicking here does show type info
}
Option-clicking closure params is something I want to do very often, as a means of exploring types of unfamiliar APIs, or to know which order the params come in, e.g. "does [1, 2, 3].enumerated() return (index, num) or (num, index)?"
Workarounds include: using the parameter in the function body and option-clicking, or manually looking up the documentation for the function.
Screenshots:
``
``
The text was updated successfully, but these errors were encountered:
Thanks for reporting this but this is an Xcode-side issue, not Swift tooling one. It would not be fixed with a change in the Swift repository, so a Swift Jira issue is not applicable.
Attachment: Download
Additional Detail from JIRA
md5: 4a13d4044e7b729d5ac80603e66587ad
Issue Description:
Quick Help in Xcode does not show type information for closure params, but does for usages of the param within the closure body.
Affected Xcode versions: This has been the case since Swift was released AFAIK, I never remember it working, but definitely Xcode 10, 11 & 12.
Example:
Option-clicking closure params is something I want to do very often, as a means of exploring types of unfamiliar APIs, or to know which order the params come in, e.g. "does [1, 2, 3].enumerated() return (index, num) or (num, index)?"
Workarounds include: using the parameter in the function body and option-clicking, or manually looking up the documentation for the function.
Screenshots:
``
``
The text was updated successfully, but these errors were encountered: