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)); }
#pragma warning restore internal static Task <Document> ReduceAsync(Document document, TextSpan span, SimplifierOptions options, CancellationToken cancellationToken) => ReduceAsync(document, SpecializedCollections.SingletonEnumerable(span), options, cancellationToken);
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)); }