Xcode Editor Menu -> Structure -> Add Documentation is inconsistent with Apple and other developer documentation best practices.

Originator:isaiah
Number:rdar://31779594 Date Originated:23-Apr-2017 07:22 PM
Status:Open Resolved:
Product:Developer Tools Product Version:XCode 8 and above
Classification:Enhancement Reproducible:Always
 
Summary:
When adding automatic documentation to Swift code the documentation is generated with documentation markup triple slash format instead of block documentation comment format.

Steps to Reproduce:
1. Create a Swift file in Xcode and add a function such as `func numberOfSections(in tableView: UITableView) -> Int`
2. Click the menu option Editor -> Structure -> Add Documentation

Expected Results:
Documentation is produced in block comment format as shown in the markup formatting reference https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_markup_formatting_ref/AddingMarkup.html#//apple_ref/doc/uid/TP40016497-CH100-SW1:
    /**
      <#Description#>

          - parameter tableView: <#tableView description#>
          - returns: <#return value description#>
    */

Actual Results:
Documentation is produced in triple slash format like so:
    /// <#Description#>
    ///
    /// - Parameter tableView: <#tableView description#>
    /// - Returns: <#return value description#>

Version:
XCode 8 and above

Notes:
I believe the best solution to this is a configurable option either at the xcodeproj, xcuserdata, or Xcode Preferences level which specifies how the "Add Documentation" output should be formatted.

Configuration:


Attachments:

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!