How do I retrieve all the methods in a C# program using the NRefactory API ?
CSharpParser parser = new CSharpParser();
SyntaxTree tree = parser.Parse(code);
This creates a SyntaxTree but how do I get ONLY the list of methods from this SyntaxTree?
There is an in depth article about using NRefactory available on CodeProject.
To get information from the SyntaxTree you can either visit the nodes or use the type system.
To visit the method declaration nodes you can do:
To use the TypeSystem you can do: