c# - Find property "invocations" with Roslyn -


I am trying to create a call graph of C # methods and properties. This essentially means that I search for projects for the MethodDeclarationSyntax and PropertyDeclarationSyntax nodes. Then I find the method between these nodes by searching through invoices:

  syntax node = ...; // Some syntax nodes var method Invokes = node. Desendend nodes and SEF (). OfType & lt; InvocationExpressionSyntax & gt; (); // Process the invocations of these systems  

Is there a method to find the same method or all the property "invokesments"? I believe the C # compiler excludes the compilation in the gateter and setter functions.

What is the best way to detect the use of properties with Roslyn?

The Roslin model is not according to the source of IL and therefore the individual calls for received and set methods. Not represented.

To do this, you will need to find MemberAccessExpression and IdentifierNameSyntax nodes and call GetSymbolInfo to see that they Mention.

Alternatively, you should consider raising a level to use the workspace model and call the FindReferences API instead.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -