travisjeffery / ClangFormat-Xcode

Xcode plug-in to to use clang-format from in Xcode and consistently format your code with Clang
https://twitter.com/travisjeffery
MIT License
2.89k stars 288 forks source link

Wrong formatting with @weakify and @strongify #45

Closed Alexey-Matjuk closed 10 years ago

Alexey-Matjuk commented 10 years ago
// Result
@weakify(self)
    NSUInteger index = [self.array indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL* stop) {
    @strongify(self)
    // TODO:
    return *stop;
    }];

// Expected result
@weakify(self)
NSUInteger index = [self.array indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL* stop) {
    @strongify(self)
    // TODO:
    return *stop;
}];
travisjeffery commented 10 years ago

put commas after weakify/strongify

andreacipriani commented 7 years ago

What's the rule to break after @weakify ?

With all the configurations that I've tried I can't reach this format:

What I would like to have:

    @weakify(self)
    return [[self foo:^(SomeClass *someClass)) {
        @strongify(self)
        [self doSomething];
        [self doSomethingElse];
    }] deliverOn:[SomeClass foo]];

The first method is always on the same line of @weakify, for example:

What I have:

    @weakify(self) return [[self foo:^(SomeClass *someClass) {
        @strongify(self)[self doSomething];
        [self doSomethingElse];
    }] deliverOn:[SomeClass foo]];