Exemplo n.º 1
0
 private void StepIntoExtensionMethod(InvocationExpressionSyntax node, InvokedMethod method)
 {
     if (context.Collector.IsExtensionMethodAlreadyCollected(method.Method, method.ArgumentTypes.First()?.Type))
     {
         StepOverExtensionMethod(node, method.Method, method.ArgumentTypes.First()?.Type);
     }
     else
     {
         context.Collector.StepIntoExtensionMethod(method.Method, method.ArgumentTypes.First()?.Type);
         var visitor = new InvocationTreeAnalyzer(context, method.DeclaringSyntaxReference.SyntaxTree.GetSemanticModel(context),
                                                  new InvokedMethod(method.Method, method.TargetType, method.ArgumentTypes, method.DeclaringSyntaxReference));
         visitor.Visit(method.DeclaringSyntaxReference.GetSyntax());
         context.Collector.StepOut();
     }
 }
 private SyntaxNode StepInto(InvocationExpressionSyntax node, InvokedMethod method)
 {
     if (context.Collector.IsAlreadyCollected(method.Method))
     {
         return(StepOver(node, method.Method));
     }
     else
     {
         context.Collector.StepInto(method.Method);
         var visitor = new InvocationTreeAnalyzer(context, method.DeclaringSyntaxReference.SyntaxTree.GetSemanticModel(context),
                                                  new InvokedMethod(method.Method, method.TargetType, method.ArgumentTypes, method.DeclaringSyntaxReference));
         visitor.Visit(method.DeclaringSyntaxReference.GetSyntax());
         context.Collector.StepOut();
         return(node);
     }
 }