From 1cab219fa6feca67f1b5d28cb46604e8f2c612e7 Mon Sep 17 00:00:00 2001 From: Luc Tremblay Date: Wed, 30 Oct 2024 23:26:51 -0400 Subject: [PATCH] AddParens only if it is not already a ParenthesizedExpressionSyntax --- CodeConverter/Util/CSharpUtil.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CodeConverter/Util/CSharpUtil.cs b/CodeConverter/Util/CSharpUtil.cs index 5372ad807..37389e31b 100644 --- a/CodeConverter/Util/CSharpUtil.cs +++ b/CodeConverter/Util/CSharpUtil.cs @@ -131,6 +131,8 @@ public static SyntaxKind GetExpressionOperatorTokenKind(SyntaxKind op) /// public static ExpressionSyntax AddParens(this ExpressionSyntax expression) { + if (expression is ParenthesizedExpressionSyntax) + return expression; return SyntaxFactory.ParenthesizedExpression(expression); }