private CommentRemover(SyntaxNode node, CommentRemoveOptions removeOptions, TextSpan span) : base(visitIntoStructuredTrivia: true) { Node = node; RemoveOptions = removeOptions; Span = span; }
public static CommentRemover Create(SyntaxNode node, CommentRemoveOptions removeOptions, TextSpan span) { if (node == null) { throw new ArgumentNullException(nameof(node)); } return(new CommentRemover(node, removeOptions, span)); }
public static TNode RemoveComments <TNode>(TNode node, CommentRemoveOptions removeOptions, TextSpan?span = null) where TNode : SyntaxNode { if (node == null) { throw new ArgumentNullException(nameof(node)); } var remover = new CommentRemover(node, removeOptions, span ?? node.FullSpan); return((TNode)remover.Visit(node)); }
private static async Task <Document> RemoveCommentAsync( Document document, CommentRemoveOptions removeOptions, CancellationToken cancellationToken = default(CancellationToken)) { SyntaxNode root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); SyntaxNode newRoot = SyntaxRemover.RemoveComment(root, removeOptions) .WithFormatterAnnotation(); return(document.WithSyntaxRoot(newRoot)); }
public static async Task <Document> RemoveCommentsAsync( Document document, CommentRemoveOptions removeOptions, CancellationToken cancellationToken = default(CancellationToken)) { if (document == null) { throw new ArgumentNullException(nameof(document)); } SyntaxNode root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); SyntaxNode newRoot = RemoveComments(root, removeOptions) .WithFormatterAnnotation(); return(document.WithSyntaxRoot(newRoot)); }
public static TNode RemoveComments <TNode>(TNode node, CommentRemoveOptions removeOptions, TextSpan span) where TNode : SyntaxNode { return(CommentRemover.RemoveComments(node, removeOptions, span)); }
private CommentRemover(SyntaxNode node, CommentRemoveOptions removeOptions) : this(node, removeOptions, node.FullSpan) { }
public static TNode RemoveComment <TNode>(TNode node, CommentRemoveOptions removeOptions, TextSpan span) where TNode : SyntaxNode { CommentRemover remover = CommentRemover.Create(node, removeOptions, span); return((TNode)remover.Visit(node)); }