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

May need an exception for open generics #832

Closed
jonstodle opened this issue Feb 20, 2023 · 0 comments · Fixed by #834
Closed

May need an exception for open generics #832

jonstodle opened this issue Feb 20, 2023 · 0 comments · Fixed by #834
Milestone

Comments

@jonstodle
Copy link

If the formatter tries to break an open generics definition over multiple lines, it ends up looking a bit silly with a line of only comma(s).

// This input
public class ClassName
{
    public void JustAMethod()
    {
        if (true)
        {
            var genericType = typeof(AnExceptionallyLongAndElaborateClassNameToMakeAnExampleRegardingOpenGenerics<,>)
                .MakeGenericType(typeof(string), typeof(int));
        }
    }
}

// Produces this output
public class ClassName
{
    public void JustAMethod()
    {
        if (true)
        {
            var genericType =
                typeof(AnExceptionallyLongAndElaborateClassNameToMakeAnExampleRegardingOpenGenerics<
                    ,
                >).MakeGenericType(typeof(string), typeof(int));
        }
    }
}
belav added a commit that referenced this issue Feb 20, 2023
@belav belav added this to the 0.23.0 milestone Feb 20, 2023
shocklateboy92 pushed a commit that referenced this issue Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants