Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//Make some impossible non-whitespace trivia
var trivia = SyntaxFactory.SyntaxTrivia(SyntaxKind.WhitespaceTrivia,
@"
public void M() {
}");
var node = SyntaxFactory.ClassDeclaration(" test")
.WithOpenBraceToken(
SyntaxFactory.Token(SyntaxKind.OpenBraceToken)
.WithTrailingTrivia(trivia)
);
Console.WriteLine(node.ToFullString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment