[clang] [clang-format] Add ObjCSpaceBeforeMethodDeclColon option to control space before Objective-C method return type (PR #170579)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 7 21:57:53 PST 2025
================
@@ -15623,6 +15623,22 @@ TEST_F(FormatTest, FormatForObjectiveCMethodDecls) {
verifyGoogleFormat("- foo:(int)foo;");
}
+TEST_F(FormatTest, SpaceBeforeObjCMethodDeclColon) {
+ FormatStyle Style = getLLVMStyle();
+ verifyFormat("- (void)method;", "-(void)method;", Style);
+ verifyFormat("+ (int)foo:(int)x;", "+ (int) foo:(int)x;", Style);
+ verifyFormat("- foo;", "-foo;", Style);
+ verifyFormat("- foo:(int)f;", "-foo:(int)f;", Style);
+
----------------
owenca wrote:
```suggestion
auto Style = getLLVMStyle();
EXPECT_TRUE(Style. ObjCSpaceBeforeMethodDeclColon);
```
https://github.com/llvm/llvm-project/pull/170579
More information about the cfe-commits
mailing list