In Visual Studio, we have the CodeLens reference counter above each property/method that tells how many C#/Visual Basic references there are to said member. However, if the member is inside a class, and is an implementation of a member within an Interface the class implements, then the reference counter doesn't reflect the number of references to the class's implementation -- it reflects the number of references to EVERY implementation of the Interface's member, in EVERY class. And the same goes for the list of those references.
This seems silly to me. If I want to find references to a Function or Property within my class, I want to find references to THAT Function or Property -- not other Functions and Properties like it within dozens of other classes.
This is particularly a problem for implementations of built-in Interfaces from the .NET framework, like IEnumerable
. I want the references counter/list for my class's GetEnumerator
method to show me where and how many times the enumerator for MY class is used -- I really don't care how many times the IEnumerable.GetEnumerator
method is referenced by every class in my solution!
So, is there any way to make the References counter/list work how I want, and only reflect the usages of the current class's implementation of Interface members? I don't see any options for this under the CodeLens options but I'm hoping there may be another way...