dotnet/roslyn

Change signature can misplace comments, whitespace

开放

#33,801 创建于 2019年3月1日

 (4 条评论) (0 个反应) (0 位负责人)C# (4,257 个派生)batch import
Area-IDEBugIDE-CodeStylehelp wanted

仓库指标

星标
 (20,414 个星标)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 256 个 PR)

描述

Version Used: 2019 Preview 4

Steps to Reproduce:

    class Program
    {
        static void F(int a, int b, int c, int d)
        {
        }

        static void Main(string[] args)
        {
            F(1,
              2,// 2
              3,
              4);
        }
    }

Remove parameter int a using Change Signature.

Expected Behavior: Comments stay with their logically related argument/parameter

Actual Behavior:

Comments can end up in unexpected locations, sometimes logically related to the wrong entry. Indentation is not preserved.

namespace ConsoleApp3
{
    class Program
    {
        static void F(int b, int c, int d)
        {
        }

        static void Main(string[] args)
        {
            F(2,
                3,// 2
                4);
        }
    }
}

贡献者指南