[PATCH] D75006: [clang-format] Wrap lines for C# property accessors

Jonathan B Coe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 25 05:47:07 PST 2020


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


================
Comment at: clang/unittests/Format/FormatTestCSharp.cpp:246
-               "    get;\n"
-               "}");
 
----------------
MyDeveloperDay wrote:
> Nit: I feel like this layout should really be an option, (maybe for the future).
> 
> When we originally did the C# work, we did say we might want in the future to add options that might be specific like laying out the accessors 
> 
> I think VS has support for formatting them as either
> 
> ```
> public int Goo { set; get; }
> ```
> 
> and 
> 
> ```
> public int Goo
> {
>      set; get;
> }
> ```
> 
> and the following is equally valid in my eyes
> 
> ```
> public int Goo
> {
>      set; 
>      get;
> }
> ```
> 
> as well as what is being proposed here of
> 
> ```
> public int Goo
> {   set; get; }
> ```
> 
> I'm not completely sure how much the other options are controlling this at present and how much is not in the control of your merging
> 
> and how does that change when there is actually code in the setter and getter?
> 
> 
> 
Agreed that this should be configured by an option in a future revision.


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

https://reviews.llvm.org/D75006





More information about the cfe-commits mailing list