https://bugs.llvm.org/show_bug.cgi?id=50515

            Bug ID: 50515
           Summary: [clang-format] successive C# attributes cause line
                    breaking issues
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

The first attribute I format is formatted as expected with a newline after the
']'

using .clang-format

Language: CSharp                                                               
                                        BasedOnStyle:  Microsoft               
                                                                               
ColumnLimit: 120
---

But if a attribute follows it renders incorrectly not breaking the line

public class State
{
  [JsonProperty("age")]
  public int? Age { get; set; }

  [JsonProperty("gender")] public string gender { get; set; }
}

if I break with a class

public class State
{
  [JsonProperty("age")]
  public int? Age { get; set; }
}

public class State2
{
  [JsonProperty("gender")] 
  public string gender { get; set; }
}

its then correct

if I break with a comment, its not correct

public class ChannelState
{
    [JsonProperty("age")]
    public int? Age { get; set; }

    // test
    [JsonProperty("gender")] public string gender { get; set; 
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to