Skip to content

Block inside container literal causes broken indentation #40

@msanders

Description

@msanders

The following currently doesn't work correctly in space commander:

@implementation Example

- (void)callbackWithSuccess:(dispatch_block_t)success
{
    NSError *error = nil;
    [self createModelWithMapping:@{
        @"key": [NSArray ins_arrayWithCount:5 usingBlock:^__nullable id (NSUInteger idx) {
            return nil;
        }],
    } error:&error];
    if (success) {
        success();
    }
}

@end

Instead, it is formatted as:

@implementation Example

- (void)callbackWithSuccess:(dispatch_block_t)success
{
    NSError *error = nil;
    [self createModelWithMapping:@{
        @"key": [NSArray ins_arrayWithCount:5 usingBlock:^__nullable id (NSUInteger idx) {
            return nil;
}],
} error:&error];
if (success) {
    success();
}
}

@end

Is there a way to work around this? It seems to be a common use case, for example when defining Mantle value transformers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions