dotnet/roslyn

Delegates are not properly reformatted when converting property from expression body to block body

Open

#71,637 opened on 2024年1月14日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)C# (4,257 forks)batch import
Area-IDEBughelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

Version Used: VS 17.8.4

Steps to Reproduce:

For both properties, open the lightbulb menu and select "Use block body for property".

class C
{
    Action A => delegate
    {
    };

    Action A2 => () =>
    {
    };
}

Expected Behavior: The block of the delegate or lambda is correctly indented. image

Actual Behavior: The indentation of the delegate body is not changed.

Interestingly, type creation expression within the property body are correctly formatted/indented: image

コントリビューターガイド