This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tree = CSharpSyntaxTree.ParseText(@" | |
public class MyClass{ | |
#region MyRegion | |
#endregion | |
}"); | |
//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