Xcode does not indent objective-c object literals

Originator:neilmggall
Number:rdar://12394453 Date Originated:28/09/2012
Status:Open Resolved:
Product:Developer Tools Product Version:4.5
Classification:UI/Usability Reproducible:Always
 
Summary:
Xcode does not apply any sensible auto-indentation to Objective-C literal arrays and dictionaries

Steps to Reproduce:
Type into Xcode:

    NSDictionary *dict = @{
        @"foo" : @(123),
        @"bar" : @(YES),
        @"qux" : @[
            @"yah",
            @"boo",
            @"sucks"
        ];
    };

Select the block and perform auto-indent to get:

    NSDictionary *dict = @{
    @"foo" : @(123),
    @"bar" : @(YES),
    @"qux" : @[
    @"yah",
    @"boo",
    @"sucks"
    ];
    };

Expected Results:

Some kind of reasonable indentation following the literal data's structure.

Actual Results:

Unreadable mess. This makes the very welcome addition of literal object syntax much less attractive in practice.

Regression:
No. Literal syntax wasn't available before.

Notes:

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!