public static TNode RemoveTrivia <TNode>(TNode node, TextSpan?span = null) where TNode : SyntaxNode { if (node == null) { throw new ArgumentNullException(nameof(node)); } return((TNode)TriviaRemover.GetInstance(span).Visit(node)); }
public static TNode RemoveTrivia <TNode>(TNode node) where TNode : SyntaxNode { if (node == null) { throw new ArgumentNullException(nameof(node)); } return(TriviaRemover.RemoveTrivia(node)); }
public static async Task <Document> RemoveTriviaAsync( this Document document, TextSpan span, CancellationToken cancellationToken = default(CancellationToken)) { if (document == null) { throw new ArgumentNullException(nameof(document)); } SyntaxNode root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); SyntaxNode newRoot = TriviaRemover.RemoveTrivia(root, span); return(document.WithSyntaxRoot(newRoot)); }