dotnet/roslyn

Formatting fixer doesn't fix formatting diagnostic

オープン

#72,534 opened on 2024/03/13

 (5 件のコメント) (0 件のリアクション) (1 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEBugFeature - Collection Expressionshelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

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