Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var tree = CSharpSyntaxTree.ParseText(@"
public class MyClass{
#region MyRegion
//Descend into all node children
//Descend into all trivia children
var regionNodes = tree.GetRoot().DescendantNodes(descendIntoChildren: null, descendIntoTrivia: true).OfType<RegionDirectiveTriviaSyntax>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment