Skip to content

An extra space will be inserted into ( and [ token for recursive pattern and list pattern #60160

@kyoyama-kazusa

Description

@kyoyama-kazusa

Version Used:
VS 17.2 p1

Steps to Reproduce:

Type code like this: using deconstruction pattern, with the list pattern as the inner one.

switch ((a, b))
{
    case ([pattern1], [pattern2]):
    {
        // ...
    }
}

Expected Behavior:

No spaces will be inserted between ( and [ token.

Actual Behavior:

Before the first deconstruction part [pattern1] will contain an extra whitespace after formatting.

( [pattern1], [pattern2])
 ↑ Here.

No matter what nested pattern is in the list pattern, extra space will be always inserted after formatting.

Image:

image

Metadata

Metadata

Assignees

Labels

Area-IDEBugFeature - List PatternsIDE-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
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions