In this subsection, you will learn how to:
- Find usages of a symbol
- Find usages of related entities
- Find dependencies and referenced code
- Optimize references
- Highlight usages in a file and step though the occurrences
- Work with Find Usages results
Besides the options mentioned above, you can set up your own code patterns and work with them. For more details, see Structural Search and Replace. (You can set up your own code patterns, search for them, replace them, include them in code analysis, and use quick-fixes to replace.)
The Find Results tool window and related ReSharper features help you locate usages of namespaces, types, methods, fields, or local variables in your code. Specifically, you can find positions in your source code where certain usages are read-only, write-only, or allow search for both read and write usages. For example, you can find getters and setters for a property, or read/write usages of a field. Depending on search settings and the number of found usages, results display in one of the following ways:
- If only one usage is found, it is marked with a tooltip "This is the only usage" right where you've invoked search (for example, in the code editor).
- Multiple usages display in a new tab of the Find Results window that enables convenient navigation, filtering and grouping.