Skip to content

Instantly share code, notes, and snippets.

Created January 21, 2015 22:36
What would you like to do?
var tree = CSharpSyntaxTree.ParseText(@"
public class MyClass{
#region MyRegion
//Try finding them as nodes.
var regionNodes = tree.GetRoot().DescendantNodes().OfType<RegionDirectiveTriviaSyntax>();
//Try finding them as trivia?
var regionTrivia = tree.GetRoot().DescendantTrivia().OfType<RegionDirectiveTriviaSyntax>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment