Skip to content

Bad formatting on property pattern in a positional pattern when line wrappingΒ #54434

@kyoyama-kazusa

Description

@kyoyama-kazusa

Version Used:
VS 17.0 Preview 1.1

Steps to Reproduce:

Type code such as

OrderingSyntax former = orderings[i], latter = orderings[j];
if (
    (former, latter) is not (
        {
            Expression: IdentifierNameSyntax
            {
                Identifier: { ValueText: var formerIdentifier }
            }
        },
        {
            Expression: IdentifierNameSyntax
            {
                Identifier: { ValueText: var latterIdentifier }
            }
        }
    )
)
{
    continue;
}

...

Expected Behavior:

The format will be like as below:

OrderingSyntax former = orderings[i], latter = orderings[j];
if (
    (former, latter) is not (
        {
            Expression: IdentifierNameSyntax
            {
                Identifier: { ValueText: var formerIdentifier }
            }
        },
        {
            Expression: IdentifierNameSyntax
            {
                Identifier: { ValueText: var latterIdentifier }
            }
        }
    )
)
{
    continue;
}

Actual Behavior:
When click the button 'Fix Formatting', then we get

Metadata

Metadata

Assignees

Labels

Area-IDEBugIDE-FormatterCode formatter and/or smart indenthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type

Projects

Status

Completed

Relationships

None yet

Development

No branches or pull requests

Issue actions