SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

method call extraction with nrefactory 5

Last post 03-08-2012 11:37 PM by DanielGrunwald. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-08-2012 11:06 PM

    method call extraction with nrefactory 5

    Hi,

    i need to extract calls and object creations from methods. In the doc/TODO file of the code, there is some related remark:

    "For each method:

        Resolve whole method with ResolveVisitor
        Ensure there are no errors detected
        Extract list of methods being called (incl. op_Implicit etc.)
    "
    How would i achieve this extraction of a list of methods beeing called?
    Thank you very much in advance for hints!
    
    
    Adrian
    Filed under:
  • 03-08-2012 11:37 PM In reply to

    Re: method call extraction with nrefactory 5

    You can use the FindReferencedEntities navigator for that.

    var navigator = new FindReferencedEntities(delegate (AstNode node, IEntity entity) { ... });

    var resolver = new CSharpAstResolver(parsedFile.GetResolver(compilation, method.StartLocation), method, parsedFile);
    resolver.ApplyNavigator(navigator);

    'method' is the MethodDeclaration you want to look in.

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.