Best way to lookup alternative (overloads) for a method
I'm looking for guidance on the best way to lookup overloaded methods...
If I'm writing an analyser and I come across a method signature or a method used as part of an expression what is the best way to lookup any overloaded methods?
Should I use the R# PSI classes or should I use .Net reflection?
Cheers
OIlie
Please sign in to leave a comment.
If you're in a plugin, you should use the PSI, since you're working with edit-time code, and not necessarily compilable code, so reflection won't help. The simplest way to get overloads is this:
You can see this in action in CSharpOverloadsContextSearch, which is what the Navigate To -> Member Overloads menu uses.
Matt - thanks for the detailed answer
Cheers
Ollie