Ejemplo n.º 1
0
        private async Task <Document> RemoveRegionAsync(Document document, SyntaxTrivia region, CancellationToken cancellationToken)
        {
            var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);

            var remover = new SingleRegionRemover(region);

            var newRoot = remover.Visit(root);

            var newDocument = document.WithSyntaxRoot(newRoot);

            return(newDocument);
        }
        private async Task<Document> RemoveRegionAsync(Document document, SyntaxTrivia region, CancellationToken cancellationToken)
        {
            var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);

            var remover = new SingleRegionRemover(region);

            var newRoot = remover.Visit(root);

            var newDocument = document.WithSyntaxRoot(newRoot);

            return newDocument;
        }