Xcode 7.0: weird indenting of #else

Originator:igeek1
Number:rdar://22760910 Date Originated:18-Sep-2015 02:17 PM
Status:Duplicate of 22225036 Resolved:21-Sep-2015 02:58 PM
Product:Developer Tools Product Version:Xcode 7.0 (7A220)
Classification:UI/Usability Reproducible:Always
 
Summary:
#else lines are indented when they should not be.

Steps to Reproduce:
1. Enter the following code into a Swift file:

#if SCREENSHOTS
let defaultColorPickerPersistentIndex = 6
#else
let defaultColorPickerPersistentIndex = 0
#endif

2. Select all the code.
3. Type Control-I to auto-indent the code.

Expected Results:
The code is unmodified.

Actual Results:
The #else is indented, so you end up with this:

#if SCREENSHOTS
let defaultColorPickerPersistentIndex = 6
    #else
let defaultColorPickerPersistentIndex = 0
#endif

Regression:
unknown

Notes:
This is as illustrated in The Swift Programming Language. However, it seems wrong to me. Control-flow statements usually line up with each other. Example:

if condition {
    // do stuff
}
else {
    // do stuff
}

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!