[PATCH] D148467: [clang-format] Add a new AfterCSharpProperty to BraceWrapping

2023-04-18 Thread Hunter T. via Phabricator via cfe-commits
StrangeRanger added a comment.

In D148467#4272231 , @MyDeveloperDay 
wrote:

> for default `set;get` or `get;set` for when `AfterCSharpProperty` is true,
>
>   public Foo {
>   set;
>   get;
>   }

At least from my experience, the getter is specified before the setter, though 
I'm unsure how important this is in your eyes.
If we assume the above sentence is always true, and the brace doesn't break 
after the property name, the following are the options in formatting that I've 
seen:

When autoproperty is used:

  public Foo {
  get;
  set;
  }
  
  // OR
  
  public FooTwo { set; get; }  // What I prefer.

When a non-autoproperty is used:

  /* When only one thing is provided in the getter and setter. */
  
  public Foo {
  get { return _next; }  
  set { _next = value; }
  }  // What I prefer.
  
  // OR
  
  public Foo {
  get => return _next; 
  set => _next = value;
  }  // Another option that I like (which really doesn't apply to this code 
change).
  
  // OR
  
  public Foo {
  get 
  { 
  return _next; 
  }  
  
  set 
  { 
  _next = value; 
  }
  }
  
  // --
  
  /* When more than one thing is provided in the getter and setter. */
  
  public Foo {
  get 
  { 
  // ...
  return _next; 
  }  
  
  set 
  { 
  _next = value;
  // ...
  }
  }

Please note that the above examples *slightly* ignore the different variations 
in how the braces could be set (new line or not).

I hope this input is enough/helps. Please let me know if you'd like any 
clarification.


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

https://reviews.llvm.org/D148467

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D148467: [clang-format] Add a new AfterCSharpProperty to BraceWrapping

2023-04-18 Thread Hunter T. via Phabricator via cfe-commits
StrangeRanger added a comment.

In D148467#4277960 , @MyDeveloperDay 
wrote:

> I'm trying to decide if I put that option in this change or in a separate 
> change (thoughts @HazardyKnusperkeks, @owenpan )

I'm not too privy to your workflow, but if by "in a separate change" you mean 
like "in a different PR", I'd probably say implement it in a different change, 
for the sake of revision history.


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

https://reviews.llvm.org/D148467

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits