/// Some description Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
/// ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
/// ut aliquip ex ea commodo consequat.
///
/// - Parameter areInIncreasingOrder: some closure that takes two arguments, but how to document the arguments?
func foo<Element>(by areInIncreasingOrder: (Element, Element) -> Bool) {
}
foo(by: { (a: Int, b: Int) in true })
It's showing "No description" now. How to add documentation of these?
/// Some description Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
/// ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
/// ut aliquip ex ea commodo consequat.
///
/// - Parameters
/// - areInIncreasingOrder: some closure that takes two arguments, but how to document the arguments?
/// - a: aaa where are you?
/// - b: bbb hello hello!!!
func foo<Element>(by areInIncreasingOrder: (_ a: Element, _ b: Element) -> Bool) {
}
Thanks for confirming! I found the problem: on the second level after - Parameters, I had one space prefix, it wants (exactly?) two spaces:
/// Some description.
///
/// - Parameters:
/// - areInIncreasingOrder: some closure that takes two arguments, but how to document the arguments?
/// - a: aaa where are you?
/// - b: bbb hello hello!!!
func foo<Element>(by areInIncreasingOrder: (_ a: Element, _ b: Element) -> Bool) {
}
Still, option-cmd-/ generate doc comment doesn't include the closure parameter. This is likely a bug.
I have the exact same issue. Option click on definition site works, but on call site it's broken. The member function I am documenting is not generic, but the struct is. I don't know if that is related, however...
Are there any updates on this? For me this still isn't working in Xcode 16 and I don't even get the table shown with closure parameters in the left column and "No description." in the right one. There is just nothing. And Xcode also complains when I try to build the documentation that it can't find the Parameter.