Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection expression inside a dictionary adds unexpected new line #1390

Closed
SigtryggurO opened this issue Nov 21, 2024 · 0 comments · Fixed by #1391
Closed

Collection expression inside a dictionary adds unexpected new line #1390

SigtryggurO opened this issue Nov 21, 2024 · 0 comments · Fixed by #1391
Milestone

Comments

@SigtryggurO
Copy link

Running on csharpier 0.30.1

Input:

static Dictionary<string, string[]> dictionary = new()
{
    {
        "Key",
        [
            "ItemWithLongEnoughNameToNotJoin1",
            "ItemWithLongEnoughNameToNotJoin2",
            "ItemWithLongEnoughNameToNotJoin3",
            "ItemWithLongEnoughNameToNotJoin4",
        ]
    },
};

Output:

static Dictionary<string, string[]> dictionary = new()
{
    {
        "Key",

        [
            "ItemWithLongEnoughNameToNotJoin1",
            "ItemWithLongEnoughNameToNotJoin2",
            "ItemWithLongEnoughNameToNotJoin3",
            "ItemWithLongEnoughNameToNotJoin4",
        ]
    },
};

Expected behavior:

static Dictionary<string, string[]> dictionary = new()
{
    {
        "Key",
        [
            "ItemWithLongEnoughNameToNotJoin1",
            "ItemWithLongEnoughNameToNotJoin2",
            "ItemWithLongEnoughNameToNotJoin3",
            "ItemWithLongEnoughNameToNotJoin4",
        ]
    },
};
@belav belav added this to the 0.30.2 milestone Nov 22, 2024
belav added a commit that referenced this issue Nov 22, 2024
@belav belav closed this as completed in e48c579 Nov 22, 2024
pisolofin pushed a commit to pisolofin/csharpier-editorconfig that referenced this issue Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants