Xcode 10.2 Incorrectly Indents Objective-C Code Inside Interface and Implementation

Originator:PaulSolt
Number:rdar://49504165 Date Originated:4-1-2018
Status:Open Resolved:
Product:Xcode Product Version:10.2
Classification:Bug Reproducible:Unable To
 
Summary:

Xcode 10.2 was incorrectly indenting my Objective-C code.

Video: https://www.useloom.com/share/9b7bf0ad85b247e6a5649484e2ae1133

I thought it was a new feature, but then my students were not seeing the same behavior. I couldn't find an option to change indentation, and my settings matched my students settings for indentation.

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController
    
    @property NSString *dogsName;
    
    @property NSString *name;
    
    
    @end

Using the indentation setting incorrectly adjust indentation of the file (@end is indented).

NOTE: Closing/opening Xcode fixes the issue, but it's still an issue that should be fixed. I haven't been able to reproduce it.

Steps to Reproduce:

1. Open Xcode
2. Create new Objective-C iOS/Mac app
3. Try to write code below a @interface or @implementation block

Expected Results:

1. Xcode should not indent my Objective-C code ... all code should be top level unless a function/method/loop.

Actual Results:

All my properties, function names are indented as if I was writing logic inside a Swift class, but I'm using Objective-C.

Version/Build:

Xcode 10.2 

Configuration: MacBook Pro 15" 2018

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!