Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Nov 26, 2023
1 parent 551f3e2 commit 32b4fdc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,13 @@ static void ReportDiagnostic(SyntaxNodeAnalysisContext context, ParenthesizedExp
&& parenthesizedExpression.IsParentKind(SyntaxKind.Argument)
&& parenthesizedExpression.Parent.Parent is BaseArgumentListSyntax argumentList)
{
int index = argumentList.Arguments.IndexOf((ArgumentSyntax)parenthesizedExpression.Parent);
SeparatedSyntaxList<ArgumentSyntax> arguments = argumentList.Arguments;
int index = arguments.IndexOf((ArgumentSyntax)parenthesizedExpression.Parent);

if (index < argumentList.Arguments.Count - 1)
if (index < arguments.Count - 1)
{
string syntax = parenthesizedExpression.Expression
+ argumentList.ToString(TextSpan.FromBounds(argumentList.Arguments[index].Span.End, argumentList.Arguments[index + 1].Span.End));
+ argumentList.ToString(TextSpan.FromBounds(arguments[index].Span.End, arguments[index + 1].Span.End));

NameSyntax name = SyntaxFactory.ParseName(syntax);

Expand Down

0 comments on commit 32b4fdc

Please sign in to comment.