From bac3c5c21d17ab88df1cbdecfe63395c2dfd27ec Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 24 Feb 2011 17:09:19 +0100 Subject: [PATCH] Use newlines in array initializers. --- .../CSharp/OutputVisitor/OutputVisitor.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/NRefactory/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs b/NRefactory/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs index 1c67668d0..88995ee47 100644 --- a/NRefactory/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs +++ b/NRefactory/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs @@ -462,7 +462,17 @@ namespace ICSharpCode.NRefactory.CSharp else style = BraceStyle.EndOfLine; OpenBrace(style); - WriteCommaSeparatedList(arrayInitializerExpression.Children); + bool isFirst = true; + foreach (AstNode node in arrayInitializerExpression.Children) { + if (isFirst) { + isFirst = false; + } else { + Comma(node); + NewLine(); + } + node.AcceptVisitor(this, null); + } + NewLine(); CloseBrace(style); return EndNode(arrayInitializerExpression); }