Skip to content

Commit 2b83ea5

Browse files
Only re-reduce things that were just expanded
1 parent 02af5b1 commit 2b83ea5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ICSharpCode.CodeConverter/CSharp/DocumentExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ private static async Task<Document> UndoBadVbExpansionsAsync(Document document,
6060
VBasic.VisualBasicSyntaxNode root)
6161
{
6262
var toSimplify = root.DescendantNodes()
63-
.Where(n => n.IsKind(VBasic.SyntaxKind.PredefinedCastExpression, VBasic.SyntaxKind.CTypeExpression, VBasic.SyntaxKind.DirectCastExpression));
63+
.Where(n => n.IsKind(VBasic.SyntaxKind.PredefinedCastExpression, VBasic.SyntaxKind.CTypeExpression, VBasic.SyntaxKind.DirectCastExpression))
64+
.Where(n => n.HasAnnotation(Simplifier.Annotation));
6465
root = root.ReplaceNodes(toSimplify, (orig, rewritten) =>
6566
rewritten.WithAdditionalAnnotations(Simplifier.Annotation)
6667
);

0 commit comments

Comments
 (0)