Browse Source

Add missing space in `new (string,int)[]`

pull/4024/head
Daniel Grunwald 4 weeks ago
parent
commit
85399bfc00
  1. 7
      ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs

7
ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs

@ -620,7 +620,11 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor @@ -620,7 +620,11 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor
{
StartNode(arrayCreateExpression);
WriteKeyword(ArrayCreateExpression.NewKeyword);
arrayCreateExpression.Type?.AcceptVisitor(this);
if (arrayCreateExpression.Type != null)
{
Space();
arrayCreateExpression.Type.AcceptVisitor(this);
}
if (arrayCreateExpression.Arguments.Count > 0)
{
WriteCommaSeparatedListInBrackets(arrayCreateExpression.Arguments);
@ -1110,6 +1114,7 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor @@ -1110,6 +1114,7 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor
{
StartNode(objectCreateExpression);
WriteKeyword(ObjectCreateExpression.NewKeyword);
Space();
objectCreateExpression.Type.AcceptVisitor(this);
bool useParenthesis = objectCreateExpression.Arguments.Any() || objectCreateExpression.Initializer is null;
if (useParenthesis)

Loading…
Cancel
Save