[PATCH] D79000: [clang-format] C# property formatting can be controlled by config options
Krasimir Georgiev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 6 10:46:48 PDT 2020
krasimir accepted this revision.
krasimir added a comment.
This revision is now accepted and ready to land.
I think this is OK as-is.
@MyDeveloperDay's suggestion of adding AfterProperty to the BraceWrapping style makes sense.
However I think in this case it is natural to use the same style for these properties and for methods (functions) until we have a reason to allow for divergence.
This MS example <https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/properties#properties-with-backing-fields> illustrates how close such "property blocks" match "function body blocks": if you squint, add an `()` before the property block and sprinkle semicolons inside it, it looks like a method.
The fact that we only need this specifically for C# properties makes it a bit niche.
I'd rather be lazy about BraceWrapping.AfterProperty and add it later, as need arises.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79000/new/
https://reviews.llvm.org/D79000
More information about the cfe-commits
mailing list