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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 19 13:31:39 PDT 2023


MyDeveloperDay added a comment.

In my C# project, these settings give me just what we tend to use.

  BreakBeforeBraces: Custom
  BraceWrapping:
    AfterFunction: true
    AfterCSharpProperty: true
  AllowShortCSharpPropertiesOnASingleLine: false
  AlwaysBreakBetweenShortCSharpProperties: false

for AutoProperties

  public int min_value
  {
      get; set;
  }

but for formal properties,

  public int Margin
  {
      get
      {
          return this.value> 0? 10 : 0;
      }
  }

although I like the idea of being able to change this to this with `AfterCSharpProperty: false`

  public int Margin
  {
      get {
          return this.value> 0? 10 : 0;
      }
  }




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

https://reviews.llvm.org/D148467



More information about the cfe-commits mailing list