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

Another very minor issue with the new C# list syntax #1059

Closed
fgimian opened this issue Dec 5, 2023 · 2 comments · Fixed by #1062
Closed

Another very minor issue with the new C# list syntax #1059

fgimian opened this issue Dec 5, 2023 · 2 comments · Fixed by #1062
Milestone

Comments

@fgimian
Copy link

fgimian commented Dec 5, 2023

Hey again, just found another very minor issue.

host.AddSection(
    name: "Kontakt Libraries (Third Party)",
    tags: Tags.SamplesUsed,
    tasks:
    [
        // TODO: Add any used third party instruments below as you discover them.
    ]
);

Is being formatted to:

host.AddSection(
    name: "Kontakt Libraries (Third Party)",
    tags: Tags.SamplesUsed,
    tasks:
    [
    // TODO: Add any used third party instruments below as you discover them.
    ]
);

I think that any code (comments included) inside the square brackets should be indented. What do you think?

Cheers
Fotis

@fgimian fgimian changed the title Anothre very minor issue with the new C# list syntax Another very minor issue with the new C# list syntax Dec 6, 2023
belav added a commit that referenced this issue Dec 8, 2023
@belav
Copy link
Owner

belav commented Dec 8, 2023

While looking into a fix for this, I found out this same problem exists in a lot of different cases.

[Attribute
// some comment
]
class Class
{
    void Method()
    {
        CallMethod(
            [
            // some comment
            ]
        );

        CallMethod(
        // some comment
        );

        var x = Array[
            1
        // some comment
        ];
    }
}

I'm sure there are more, close brackets also exist in these other node types. I didn't figure out how many places closing parenthesis exists.

ArrayRankSpecifierSyntax
FunctionPointerUnmanagedCallingConventionListSyntax
ImplicitArrayCreationExpressionSyntax
ImplicitStackAllocArrayCreationExpressionSyntax
ListPatternSyntax
BracketedParameterListSyntax
CrefBracketedParameterListSyntax

Some of these are unlikely to occur in real code, so instead of trying to address them all I'm thinking just fix them as they come up.

@belav belav added this to the 0.26.5 milestone Dec 8, 2023
@fgimian
Copy link
Author

fgimian commented Dec 10, 2023

Thank you so much for your help! 😊

belav added a commit that referenced this issue Dec 10, 2023
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