dotnet/roslyn

Unexpected formatting when attribute is on same line as property with default value

開放

#50,017 建立於 2020年12月16日

 (1 則留言) (0 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-IDEBugIDE-Formatterhelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

The code

namespace Foo
{
    public class Bar
    {
        [Parameter] public DelegateType Value { get; set; } = (value, second) => (builder) =>
        {
            builder.Baz();
        };
    }
}

reformats to

namespace Foo
{
    public class Bar
    {
        [Parameter]
        public DelegateType Value { get; set; } = (value, second) => (builder) =>
{
builder.Baz();
};
    }
}

I would expect

namespace Foo
{
    public class Bar
    {
        [Parameter]
        public DelegateType Value { get; set; } = (value, second) => (builder) =>
        {
            builder.Baz();
        };
    }
}

or actually to do nothing at all.


dotnet format version is 4.1.131201

貢獻者指南