So I currently write code analyzer with roslyn for c#, but now I'm stuck.
I want to analyze extension methods. It is demanded that the namespace the extension is declared in, equals the namespace of the class passed with the 'this' argument.
Example:
namespace Project.Test
{
public static class Test
{
public static SomeCustomClass MethodName( this SomeCustomClass object )
{
//...
}
}
}
So I want to get the original namespace of "SomeCustomClass". It is defined somewhere in the solution.
I'm really struggling with this one. Thanks for the help and have a nice day!
TL;DR How do I get the original namespace of a class, when it is referenced in another file and/or another namespace?