[PATCH] D116417: [clang][ObjC] Add fix it for missing methods in impl

David Goldman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 4 10:34:32 PST 2022


dgoldman marked an inline comment as done.
dgoldman added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclObjC.cpp:2241
+    method->print(Out, Policy);
+    Str.append(" {\n\n}\n\n");
+
----------------
sammccall wrote:
> sammccall wrote:
> > nit: mixing string & output stream modifications is a bit confusing
> I think this should probably only have one inside and one at the end.
> 
> Fixits aren't really in the business of formatting the code to be further modified.
> I can't find examples of fixits inserting blank lines that aren't necessary, apart from at the end of decls.
> 
> One newline between empty braces seems to be LLVM's style for objc. (For C++ it's zero newlines)
I changed it to be one newline between the braces but 2 before the @end so you get

```
- (void)something {
}

@end
```

since I think that's more common


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116417/new/

https://reviews.llvm.org/D116417



More information about the cfe-commits mailing list