Exemple #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));
        }
Exemple #3
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));
        }