title: Roslyn Region Trivia
body: <p>How do I create a RegionDirectiveTriviaSyntax?</p>
  
  <p>Below is as close as I have gotten and it fails. The third parameter is defined as a "name" but there is not a type for that. I have tried literal, identifier and several others kinds of tokens but they all complain about the Kind. And is there a correct way to parse one so I don't have to do the "Replace"?</p>
  
  <p><code>trivia</code> is an existing C# SyntaxTrivia and I am creating a VB RegionDirectiveTriviaSyntax:</p>
  
  <pre><code>Dim node As RegionDirectiveTriviaSyntax =
                  SyntaxFactory.RegionDirectiveTrivia
                                (SyntaxFactory.Token(SyntaxKind.HashToken),
                                 SyntaxFactory.Token(SyntaxKind.RegionKeyword),
                                 SyntaxFactory.Token
                                               (SyntaxKind.IdentifierToken, 
                                                trivia.ToString.Replace("#region ", "")
                                               )
                                )
  </code></pre>