Syntax model and Semantic model communication
I have an "InvocationExpressionSyntax" "invocation" , from which i want to access "MethodDeclarationSyntax".
Don't want just to compare their names, because the method parameters may differ.
By using semantic model I got access to Operation of invocation. By operation I have an access to TargetMethod. I would like to get MethodDeclarationSyntax of that method.
var operation = (IInvocationOperation) semanticModel.GetOperation(invocation);
var methodInvoked = operation.TargetMethod;