From 65dfeb03f78a16cf68c883869acd387f0e876b13 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 18 Apr 2019 19:02:51 +0200 Subject: [PATCH] #1485: Fix indentation bug if member reference expression is not wrapped in invocation expression. --- .../CSharp/OutputVisitor/CSharpOutputVisitor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs b/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs index 729ca4b9e..b6cfcb39b 100644 --- a/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs +++ b/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs @@ -903,6 +903,10 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor WriteToken(Roles.Dot); WriteIdentifier(memberReferenceExpression.MemberNameToken); WriteTypeArguments(memberReferenceExpression.TypeArguments); + if (!(memberReferenceExpression.Parent is InvocationExpression)) { + if (GetCallChainLengthLimited(memberReferenceExpression) >= 3) + writer.Unindent(); + } EndNode(memberReferenceExpression); }