Roslyn Get Method Declaration from InvocationExpression
If you need the declaration of the method that you are calling, you can get that as follows. In the first step, you find out what method it is that is being called: var methodSymbol = context .SemanticModel .GetSymbolInfo(invocation, context.CancellationToken) .Symbol as IMethodSymbol; Remember that there are various reasons why the methodSymbol may be null … Read more