Table of Contents

Class CommentRemover

Namespace
SunamoRoslyn.Services
Assembly
SunamoRoslyn.dll

A syntax rewriter that removes all comment trivia from a C# syntax tree.

public class CommentRemover : CSharpSyntaxRewriter
Inheritance
CommentRemover
Inherited Members
Extension Methods

Methods

VisitTrivia(SyntaxTrivia)

Visits a trivia node and removes it if it is a comment.

public override SyntaxTrivia VisitTrivia(SyntaxTrivia trivia)

Parameters

trivia SyntaxTrivia

The syntax trivia to visit.

Returns

SyntaxTrivia

An empty trivia if the input is a comment; otherwise, the original trivia.