Skip to content

Instantly share code, notes, and snippets.

@JoshVarty
Created March 30, 2015 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshVarty/55e7a9b45735c5923b2a to your computer and use it in GitHub Desktop.
Save JoshVarty/55e7a9b45735c5923b2a to your computer and use it in GitHub Desktop.
//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