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
18.93k stars 4.02k forks source link

Replace 'xxx' with method has bug #75186

Open vsfeedback opened 2 days ago

vsfeedback commented 2 days ago

This issue has been moved from a ticket on Developer Community.


GIF 2024-09-15 오후 5-37-40.gif


Original Comments

Feedback Bot on 9/18/2024, 04:59 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

sharwell commented 2 days ago

Input code

class A
{
    #region
    static bool a;
    #endregion
    static bool b => true;
}

Steps

Run Replace 'b' with method on property b.

Actual result

class A
{
    #region
    static bool a;

    #endregion
    #endregion
    private static bool Getb()
    {
        return true;
    }
}

Expected result

class A
{
    #region
    static bool a;
    #endregion
    private static bool Getb()
    {
        return true;
    }
}