Find Usages of Related Entities
This command enables you to find usages of entities that are somehow related to the selected symbol (for example, textual occurrences, dynamic references, and so on) in the specific scope. You can invoke this command from the Solution Explorer, from File Structure and other tool windows.
Find usages of related entities from the current context
Place the caret at a symbol in the editor or select the symbol in a tool window.
Press Shift+Alt+F7 or choose
in the main menu.In the Search Properties dialog that opens, you can customize your search.
Use checkboxes in the Find column to specify what kind of relates symbols should be included in the results. Depending on the original symbol, the set of options varies. For example, if it is a type, you can look for usages of members; if it is a delegate, you can look for delegate target, and so on. For more information, see Find options for different symbols.
In the Scope column, choose the scope of the search.
If the original symbol is an overriding member in a derived class or an implemented interface member, ReSharper displays the original member and all its base members in the Search field. You choose whether to look for usages of the base member or those of the overriding member.
Click Find.
If a single usage is found, ReSharper will navigate you to the usage directly in the editor. Two or more search results will be shown in the Find Results window, where you can conveniently explore and analyze the usages.
Find usages of entities related to any symbol from the solution and referenced assemblies
Search the desired symbol using one of the following commands:
Search Everywhere/Go to Type Control+N
Go to Symbol Shift+Control+Alt+N
Go to File Member Control+F12
When the desired symbol appears in the results list, select it using the keyboard and then press Shift+Alt+F7.
If a single usage is found, ReSharper will navigate you to the usage directly in the editor. Two or more search results will be shown in the Find Results window, where you can conveniently explore and analyze the usages.
![ReSharper. 'Search Properties' dialog ReSharper. 'Search Properties' dialog](https://resources.jetbrains.com/help/img/dotnet/2022.3/Reference__Search_Properties__method_overriding.png)
You can change the default behavior so that even the single found usage is also displayed in the Find Results window. To do so, clear the Go to Usage: if there is only one result.... checkbox on the page of ReSharper options (Alt+R, O).
Find options for different symbols
Usages | Usages of members | Derived types | Delegate targets | Textual occurrences | Late-bound references 1) | Extending interfaces | Implementations | Implementing methods | Include overloading | Overriding… | |
---|---|---|---|---|---|---|---|---|---|---|---|
Classes | |||||||||||
Constants | |||||||||||
Constructors | |||||||||||
Delegates | |||||||||||
Enumeration members | |||||||||||
Enumerations | |||||||||||
Events | |||||||||||
Fields | |||||||||||
Files | |||||||||||
Indexers | |||||||||||
Interfaces | |||||||||||
Methods (base) | |||||||||||
Methods (overriding, standalone) | |||||||||||
Namespaces | |||||||||||
Operators | |||||||||||
Parameters | |||||||||||
Properties | |||||||||||
Structs | |||||||||||
Type parameters | |||||||||||
Variables |
1) Late-bound references are references to members of objects that are bound to a specific type as late as at runtime. Late-bound references are allowed in VB.NET, ASP.NET, and XAML. Starting from version 4.0, late binding is also available in C# with the dynamic
keyword.
For example, obj.DoSomething()
in the following VB.NET subroutine is a late-bound reference since it's not known before runtime if an object passed to the subroutine does actually have a method DoSomething()
:
2) Available for events with virtual
modifier. (back)
3) If available. (back)
4) Available for indexers with virtual
modifier. (back)
5) If available. (back)
6) If available. (back)
7) If available. (back)
8) If available. (back)
This feature is supported in the following languages and technologies:
The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by language section.