private static Task <Document> RemoveParameterNameFromArgumentsAsync( Document document, AttributeArgumentListSyntax argumentList, AttributeArgumentSyntax[] arguments, CancellationToken cancellationToken = default) { AttributeArgumentListSyntax newArgumentList = RemoveParameterNameSyntaxRewriter.VisitNode(argumentList, arguments) .WithFormatterAnnotation(); return(document.ReplaceNodeAsync(argumentList, newArgumentList, cancellationToken)); }
private static async Task <Document> RemoveParameterNameFromArgumentsAsync( Document document, ArgumentListSyntax argumentList, ImmutableArray <ArgumentSyntax> arguments, CancellationToken cancellationToken = default(CancellationToken)) { ArgumentListSyntax newArgumentList = RemoveParameterNameSyntaxRewriter.VisitNode(argumentList, arguments) .WithFormatterAnnotation(); return(await document.ReplaceNodeAsync(argumentList, newArgumentList, cancellationToken).ConfigureAwait(false)); }
public static AttributeArgumentListSyntax VisitNode(AttributeArgumentListSyntax argumentList, AttributeArgumentSyntax[] arguments = null) { if (arguments == null) { return((AttributeArgumentListSyntax)_instance.Visit(argumentList)); } else { var instance = new RemoveParameterNameSyntaxRewriter(arguments); return((AttributeArgumentListSyntax)instance.Visit(argumentList)); } }
private static async Task <Document> RemoveParameterNameFromArgumentsAsync( Document document, AttributeArgumentListSyntax argumentList, AttributeArgumentSyntax[] arguments, CancellationToken cancellationToken = default(CancellationToken)) { SyntaxNode oldRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); AttributeArgumentListSyntax newArgumentList = RemoveParameterNameSyntaxRewriter.VisitNode(argumentList, arguments) .WithFormatterAnnotation(); SyntaxNode newRoot = oldRoot.ReplaceNode(argumentList, newArgumentList); return(document.WithSyntaxRoot(newRoot)); }
public static TNode VisitNode <TNode>(TNode node, IEnumerable <ArgumentSyntax> arguments) where TNode : SyntaxNode { var remover = new RemoveParameterNameSyntaxRewriter(arguments); return((TNode)remover.Visit(node)); }
public static TNode VisitNode <TNode>(TNode node) where TNode : SyntaxNode { var remover = new RemoveParameterNameSyntaxRewriter(); return((TNode)remover.Visit(node)); }