dotnet/roslyn

Formatting fixer doesn't fix formatting diagnostic

Open

#72,534 建立於 2024年3月13日

在 GitHub 查看
 (5 留言) (0 反應) (1 負責人)C# (4,257 fork)batch import
Area-IDEBugFeature - Collection Expressionshelp wanted

倉庫指標

Star
 (20,414 star)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 256 個 PR)

描述

Considering the following sample:


    class C
    {
        void M()
        {
            string[] x = [
"""
string
""",
"""
string
"""];
        }
    }

A formatting diagnostic is produced following the comma inside the collection expression: image

When invoking the format fixer, nothing happens. When previewing the formatting fix, an empty box is displayed:

image

I still question the choice to produce that diagnostic, given that raw string literals are not prescriptive about whether to indent and some people (like myself) prefer to left indent them for clarity.
But regardless of that design question, I would expect the fixer to be able to fix formatting issues that are reported.

貢獻者指南