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.09k stars 4.04k forks source link

`Replace 'Property' with method` erases DIM #75999

Open RenderMichael opened 1 day ago

RenderMichael commented 1 day ago

Version Used:

.NET SDK 9.0.100

Steps to Reproduce: Existing code:

interface I
{
    public string Name
    {
        get
        {
            return string.Empty;
        }
    }
}

After fix:

interface I
{
    string GetName();
}

Diagnostic Id:

IDE did not present one, so I'm unsure whether this is the right repo, or if this is implemented in roslyn-analyzers

Expected Behavior:

interface I
{
    public string GetName()
    {
        return string.Empty;
    }
}

Actual Behavior:

interface I
{
    string GetName();
}
CyrusNajmabadi commented 1 day ago

This is the correct repo for this.