|
|
|
@ -23,9 +23,7 @@ using ICSharpCode.Decompiler.CSharp;
@@ -23,9 +23,7 @@ using ICSharpCode.Decompiler.CSharp;
|
|
|
|
|
using ICSharpCode.Decompiler.CSharp.OutputVisitor; |
|
|
|
|
using ICSharpCode.Decompiler.CSharp.Syntax; |
|
|
|
|
using ICSharpCode.Decompiler.IL; |
|
|
|
|
using ICSharpCode.Decompiler.Metadata; |
|
|
|
|
using ICSharpCode.Decompiler.TypeSystem; |
|
|
|
|
using SRM = System.Reflection.Metadata; |
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.Decompiler |
|
|
|
|
{ |
|
|
|
@ -40,9 +38,6 @@ namespace ICSharpCode.Decompiler
@@ -40,9 +38,6 @@ namespace ICSharpCode.Decompiler
|
|
|
|
|
bool firstUsingDeclaration; |
|
|
|
|
bool lastUsingDeclaration; |
|
|
|
|
|
|
|
|
|
public bool FoldBraces = false; |
|
|
|
|
public bool ExpandMemberDefinitions = false; |
|
|
|
|
|
|
|
|
|
public TextTokenWriter(ITextOutput output, DecompilerSettings settings, IDecompilerTypeSystem typeSystem) |
|
|
|
|
{ |
|
|
|
|
if (output == null) |
|
|
|
@ -96,7 +91,7 @@ namespace ICSharpCode.Decompiler
@@ -96,7 +91,7 @@ namespace ICSharpCode.Decompiler
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (firstUsingDeclaration) { |
|
|
|
|
output.MarkFoldStart(defaultCollapsed: true); |
|
|
|
|
output.MarkFoldStart(defaultCollapsed: !settings.ExpandUsingDeclarations); |
|
|
|
|
firstUsingDeclaration = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -220,15 +215,15 @@ namespace ICSharpCode.Decompiler
@@ -220,15 +215,15 @@ namespace ICSharpCode.Decompiler
|
|
|
|
|
} |
|
|
|
|
if (braceLevelWithinType >= 0 || nodeStack.Peek() is TypeDeclaration) |
|
|
|
|
braceLevelWithinType++; |
|
|
|
|
if (nodeStack.OfType<BlockStatement>().Count() <= 1 || FoldBraces) { |
|
|
|
|
output.MarkFoldStart(defaultCollapsed: !ExpandMemberDefinitions && braceLevelWithinType == 1); |
|
|
|
|
if (nodeStack.OfType<BlockStatement>().Count() <= 1 || settings.FoldBraces) { |
|
|
|
|
output.MarkFoldStart(defaultCollapsed: !settings.ExpandMemberDefinitions && braceLevelWithinType == 1); |
|
|
|
|
} |
|
|
|
|
output.Write("{"); |
|
|
|
|
break; |
|
|
|
|
case "}": |
|
|
|
|
output.Write('}'); |
|
|
|
|
if (role != Roles.RBrace) break; |
|
|
|
|
if (nodeStack.OfType<BlockStatement>().Count() <= 1 || FoldBraces) |
|
|
|
|
if (nodeStack.OfType<BlockStatement>().Count() <= 1 || settings.FoldBraces) |
|
|
|
|
output.MarkFoldEnd(); |
|
|
|
|
if (braceLevelWithinType >= 0) |
|
|
|
|
braceLevelWithinType--; |
|
|
|
|