Skip to content

Dotnet format array spread operator styling #79482

@garcipat

Description

@garcipat

Brief description:

I noticed that dotnet format is changing styles in our code with the array spread operator from

var x = [..y] to var x[.. y]

by adding a space in between. For me this is not good sicne the dots are getting separated from its context, that in this case is y.

I wasnt able to find any style configuration in Visual Studio nor an analyzer rule that tells todo so. Other formatting rules have an analyzer to have some control over it.

Languages applicable:

There is no analyzer for it, thats the issue.

Code example that the analyzer should report:

var x = [..y] is formatted to var x[.. y]

Documentation requirements:

When this analyzer is implemented, it must be documented by following the steps at Documentation for IDE CodeStyle analyzers.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions