dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.07k stars 4.04k forks source link

Converting setter to block body leaves set keyword on getter line #23251

Open jnm2 opened 7 years ago

jnm2 commented 7 years ago

VS 15.5p4, apologies if there's an existing issue I failed to locate.

I frequently have code like this:

private bool someProperty;
public bool SomeProperty { get => someProperty; set => Set(ref someProperty, value); }

And need to add code to the setter, so I use the block body code action. This results in:

private bool someProperty;
public bool SomeProperty
{
    get => someProperty; set
    {
        Set(ref someProperty, value);
    }
}

I would expect set to be on its own line.

CyrusNajmabadi commented 4 weeks ago

we'd take a small community fix on this.