Example #1
0
        internal static async Task <Document> ReduceAsync(Document document, SyntaxAnnotation annotation, SimplifierOptions options, CancellationToken cancellationToken)
        {
            var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);

            return(await ReduceAsync(document, root.GetAnnotatedNodesAndTokens(annotation).Select(t => t.FullSpan), options, cancellationToken).ConfigureAwait(false));
        }
Example #2
0
#pragma warning restore

        internal static Task <Document> ReduceAsync(Document document, TextSpan span, SimplifierOptions options, CancellationToken cancellationToken)
        => ReduceAsync(document, SpecializedCollections.SingletonEnumerable(span), options, cancellationToken);
Example #3
0
        internal static async Task <Document> ReduceAsync(Document document, SimplifierOptions options, CancellationToken cancellationToken)
        {
            var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);

            return(await ReduceAsync(document, root.FullSpan, options, cancellationToken).ConfigureAwait(false));
        }