Skip to content

Block inside container literal causes broken indentation #40

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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