Skip to content

Commit 5f32b6d

Browse files
Fix folding of extension declarations
1 parent 5f0e767 commit 5f32b6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ICSharpCode.Decompiler/Output/TextTokenWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public override void WriteToken(Role role, string token)
255255
}
256256
if (braceLevelWithinType >= 0 || nodeStack.Peek() is TypeDeclaration)
257257
braceLevelWithinType++;
258-
if (nodeStack.PeekOrDefault() is TypeDeclaration or BlockStatement { Parent: EntityDeclaration or LocalFunctionDeclarationStatement or AnonymousMethodExpression or LambdaExpression } || settings.FoldBraces)
258+
if (nodeStack.PeekOrDefault() is TypeDeclaration or ExtensionDeclaration or BlockStatement { Parent: EntityDeclaration or LocalFunctionDeclarationStatement or AnonymousMethodExpression or LambdaExpression } || settings.FoldBraces)
259259
{
260260
output.MarkFoldStart(defaultCollapsed: !settings.ExpandMemberDefinitions && braceLevelWithinType == 1, isDefinition: braceLevelWithinType == 1);
261261
}
@@ -265,7 +265,7 @@ public override void WriteToken(Role role, string token)
265265
output.Write('}');
266266
if (role != Roles.RBrace)
267267
break;
268-
if (nodeStack.PeekOrDefault() is TypeDeclaration or BlockStatement { Parent: EntityDeclaration or LocalFunctionDeclarationStatement or AnonymousMethodExpression or LambdaExpression } || settings.FoldBraces)
268+
if (nodeStack.PeekOrDefault() is TypeDeclaration or ExtensionDeclaration or BlockStatement { Parent: EntityDeclaration or LocalFunctionDeclarationStatement or AnonymousMethodExpression or LambdaExpression } || settings.FoldBraces)
269269
output.MarkFoldEnd();
270270
if (braceLevelWithinType >= 0)
271271
braceLevelWithinType--;

0 commit comments

Comments
 (0)