Bizhan
Bizhan

Reputation: 17155

Find All References to an overriden method in VisualStudio

I have an interface ISomething which defines GetSomething().

I have a bunch of classes Something1, Something2,... all implement ISomething and therefore GetSomething().

When I right-click on Something1.GetSomething() and click Find All References, VisualStudio shows all references to ISomething.GetSomething() instead of the actual derived class.

I'm wondering if there is a way to navigate to Something1.GetSomething() without scrolling down all the implementations of GetSomething()

Upvotes: 15

Views: 2377

Answers (2)

Peter Sladek
Peter Sladek

Reputation: 910

Found another way today that is using standard Find References results window. Just use Find All References as usual and then in results window right click anywhere on table header and check Show Columns -> Definition. And then click on Definition column and set filter just to overriden member you are interested in.

enter image description here

Upvotes: 1

Jimmy
Jimmy

Reputation: 28456

Right next to Find All References is View Call Hierarchy. It breaks up references to the selected member into 3 groups: Calls To, Calls From, and Implements. You're probably looking for the last one.

Call Hierarchy

Upvotes: 20

Related Questions