Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 3
0
 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));
     }
 }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
            public static TNode VisitNode <TNode>(TNode node, IEnumerable <ArgumentSyntax> arguments) where TNode : SyntaxNode
            {
                var remover = new RemoveParameterNameSyntaxRewriter(arguments);

                return((TNode)remover.Visit(node));
            }
Ejemplo n.º 6
0
            public static TNode VisitNode <TNode>(TNode node) where TNode : SyntaxNode
            {
                var remover = new RemoveParameterNameSyntaxRewriter();

                return((TNode)remover.Visit(node));
            }