Find Usages of Symbols
ReSharper | Find | Find Usages
ShiftF12 (ReSharper_FindUsages
)
This command allows finding all usages of one or more symbols in the solution and referenced assemblies. You can start the search from the declaration of the symbol or from any other usage. You can invoke this command from the Solution Explorer, File Structure window, and other tool windows.
tip
You can invoke Go to Declaration even if your caret is on a declaration to navigate through symbol usages.
Place the caret at a symbol in the editor or select the symbol in a tool window.
Do one of the following:
From the main menu, choose ReSharper | Find | Find Usages.
Right-click and choose Find Usages in the context menu.
Press ShiftF12.
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.
You can also list and study symbol usages in the Peek Definition view.
To do so, by default you can Ctrl-click the declaration or any usage with the middle mouse button. If you want to disable this, clear the Use Ctrl+Middle Button Click Peek Usages checkbox on the Environment | Search & Navigation page of ReSharper options Alt+R, O. Or you can always invoke this command from the main menu: ReSharper | Navigate | Peek | Peek Usages.
Search the desired symbol using one of the following commands:
Search Everywhere/Go to Type Ctrl0T
Go to Symbol AltShift0T
Go to File Member Alt0\
When the desired symbol appears in the results list, select it using the keyboard and then press ShiftF12.
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.
tip
ReSharper also provides the Go to Usages of Symbol command, which can be more convenient if you are looking for a specific usage and want to get to this usage without opening the Find Results window.
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 Environment | Search & Navigation | General page of ReSharper options Alt+R, O.
![ReSharper: Finding Usages of a Symbol ReSharper: Finding Usages of a Symbol](https://resources.jetbrains.com/help/img/dotnet/2024.3/Navigation_and_Search__Finding_Usages__Find_Usages__one_and_several.png)
It is also possible to search for usages of multiple symbols declared in a specific scope, that is in one or more files, folders, or projects.
In the Solution Explorer, select one or more nodes — files, declarations inside them, folders, or projects.
Press ShiftF12.
Search results will be shown in the Find Results window, where you can see all declarations in that scope (search targets) and all usages of these symbols in the solution.
tip
Another way to find usages of multiple symbols is to find code dependent on referenced modules
When searching for usages of generic types such as IFoo<string>
, you may actually want to find either all usages of IFoo<>
or usages of the exact generic substitution IFoo<string>
only.
By default, ReSharper allows you to disambiguate the search results by showing an additional popup.
You can also configure the feature so that a specific search logic (either all substitutions or the exact substitution) should be always performed. To do so, use the Find generic type usages behavior selector on the Environment | Search & Navigation | General page of ReSharper options Alt+R, O.
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 more information about other languages, refer to corresponding topics in the Languages and frameworks section.