Xcode "Add Documentation" feature ignores "Throws" and "Returns"

Originator:mfernandes.fernando
Number:rdar://FB7541468 Date Originated:Jan 18, 2020
Status:Open Resolved:
Product:Xcode Product Version:11.3.1 (11C504)
Classification: Reproducible:Yes
 
Please describe the issue:
Xcode's "Add Documentation" feature completely ignore "Throws" and "Returns".

For example, consider the method signature below:
func context(for size: CGSize, settings: SImageSettings = SImageSettings()) throws -> CGContext { ... }

This is what I get with "⌘ + ⌥ + /":

    /// <#Description#>
    /// - Parameters:
    ///   - size: <#size description#>
    ///   - settings: <#settings description#>
    func context(for size: CGSize, settings: SImageSettings = SImageSettings()) throws -> CGContext {
        // Function body.
    }

Expected:

    /// <#Description#>
    /// - Parameters:
    ///   - size: <#size description#>
    ///   - settings: <#settings description#>
    /// - Throws: 👈🏻
    /// - Returns: 👈🏻
    func context(for size: CGSize, settings: SImageSettings = SImageSettings()) throws -> CGContext {
        // Function body.
    }
Please list the steps you took to reproduce the issue:
Create a function that receives parameters, "throws" and "returns". For example:

enum DummyError: Error {
    case dummy
}

func dummy(number: Int) throws -> Int {
    if 1 > 2 {
        return 1
    } else {
        throw DummyError.dummy
    }
}

Press "⌘ + ⌥ + /" to "Add Documentation" to the function.
What did you expect to happen?
Expected documentation:
/// <#Description#>
/// - Parameter number: <#number description#>
/// - Throws: ...
/// - Returns: ...
What actually happened?
Generated documentation:
/// <#Description#>
/// - Parameter number: <#number description#>

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!