Retain Objective-C's colon indentation in Swift
| Originator: | steve_w101 | ||
| Number: | rdar://17216208 | Date Originated: | 7-June-2014 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 6.0 |
| Classification: | Reproducible: | Always |
Summary:
In Objective-C I can write a method call over several lines and they are indented according to where the colon appears.
- (NSError *)doSomething
{
return [NSError errorWithDomain:@"MyCustomDomain"
code:42
userInfo:nil];
}
Though I'm not convinced the formatting of this page will maintain Xcode's formatting. Hopefully the intention is obvious.
Steps to Reproduce:
Create the following function in a Swift file.
func doSomething() -> NSError {
return NSError(domain: "MyCustomDomain", code: 42, userInfo: nil)
}
Add a line break before code: and userInfo:
Expected Results:
domain: code: and userInfo: should all line up based on the position of the colon character.
func doSomething() -> NSError {
return NSError(domain: "MyCustomDomain",
code: 42,
userInfo: nil)
}
Actual Results:
It appears to indent the lines by 4 characters beyond the beginning of the previous line.
func doSomething() -> NSError {
return NSError(domain: "MyCustomDomain",
code: 42,
userInfo: nil)
}
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!