Skip to content

Instantly share code, notes, and snippets.

@JoshVarty
Created October 25, 2015 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshVarty/2b2d3c17ec261c9d00ba to your computer and use it in GitHub Desktop.
Save JoshVarty/2b2d3c17ec261c9d00ba to your computer and use it in GitHub Desktop.
public class MethodSymbolVisitor : SymbolVisitor
{
//NOTE: We have to visit the namespace's children even though
//we don't care about them. :(
public override void VisitNamespace(INamespaceSymbol symbol)
{
foreach(var child in symbol.GetMembers())
{
child.Accept(this);
}
}
//NOTE: We have to visit the named type's children even though
//we don't care about them. :(
public override void VisitNamedType(INamedTypeSymbol symbol)
{
foreach(var child in symbol.GetMembers())
{
child.Accept(this);
}
}
public override void VisitMethod(IMethodSymbol symbol)
{
Console.WriteLine(symbol);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment