Xcode should align colons following parameter names in Swift code
| Originator: | kristopherdjohnson | ||
| Number: | rdar://18381061 | Date Originated: | 18-Sep-2014 12:08 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 6.0.1 |
| Classification: | Enhancement | Reproducible: | Not applicable |
Summary:
In Objective-C, the standard convention for indenting parameters in a multi-line message-send is to align the colons that follow each parameter name, like this:
[self deserializeReportJSON: JSON
inContext: context
success: successBlock
failure: failureBlock];
(View the above with a monospace font.)
Xcode does not align parameters like this for Swift code, making it more difficult to quickly scan the parameters in a multi-line method call. It would be nice if Xcode provided the option to align parameters in Swift as it does for Objective-C.
Steps to Reproduce:
Paste the following into a Swift code file:
var error: NSError?
let data = NSJSONSerialization.dataWithJSONObject( jsonObject,
options: NSJSONWritingOptions(0),
error: &error)
Expected Results:
Expect to see the original text, indented in a readable manner
Actual Results:
Indentation is lost, and result is harder to read:
var error: NSError?
let data = NSJSONSerialization.dataWithJSONObject( jsonObject,
options: NSJSONWritingOptions(0),
error: &error)
Version:
Xcode 6.0.1
Notes:
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!
Seconded! Seems ironic considering Swift is specifically designed to be easily read…