private SyntaxNode VisitArguments( ImmutableArray <TExpressionSyntax> expandedArguments, SyntaxNode interpolatedString, ISyntaxFactsService syntaxFactsService) { return(interpolatedString.ReplaceNodes(syntaxFactsService.GetContentsOfInterpolatedString(interpolatedString), (oldNode, newNode) => { var interpolationSyntaxNode = newNode; if (interpolationSyntaxNode != null) { var literalExpression = syntaxFactsService.GetExpressionOfInterpolation(interpolationSyntaxNode) as TLiteralExpressionSyntax; if (literalExpression != null && syntaxFactsService.IsNumericLiteralExpression(literalExpression)) { if (int.TryParse(literalExpression.GetFirstToken().ValueText, out var index)) { if (index >= 0 && index < expandedArguments.Length) { return interpolationSyntaxNode.ReplaceNode( syntaxFactsService.GetExpressionOfInterpolation(interpolationSyntaxNode), syntaxFactsService.ConvertToSingleLine(expandedArguments[index], useElasticTrivia: true).WithAdditionalAnnotations(Formatter.Annotation)); } } } } return newNode; })); }