- 3 min to read
With the CodeRush, you can easily find all references to a specified symbol. There are two ways to find a reference.
- Quickly navigate to the next reference (Tab to Next Reference).
- List all references in the solution and navigate to the required one (Find All References).
Tab to Next Reference
This feature enables you to jump to a reference with a single key press.
Place the caret on an identifier and press Tab. As a result, all references on the screen will be underlined, and the caret will move to the next one.
If the next reference is not the one you are looking for, continue pressing Tab or Shift+Tab until you reach the desired one, or just click it. Tab to Next Reference searches for references in the entire solution. If the next reference is found in the closed file, it will be opened and the caret will be placed to the required position within the file.
Find All References
This feature enables you to see all references in the solution and jump to the required one.
Place the caret on an identifier and press Shift + F12 to open the References Window, which contains all usages of the identifier found in your solution.
You can also call the Find All References command using the CodeRush | Navigate | Find All References menu item.
The References Window supports the following operations.
Navigating to code
- Double-click an item in the list
- While the window is open, use the F8 key to navigate to the next item
- While the window is open, use the Shift + F8 shortcut to navigate to the previous item
Grouping items (by any combination of the following entities)
- By the project
- By the file
- By the namespace
- By the type (class, interface, etc.)
- By the member
Filtering items by operation type
- Read operations
- Write opertaions
- All opertaions
- Displaying the surrounding code (preview) for the selected item
- Filtering items by text (searching for text in the string where the reference was found)
The References Window supports sessions that enable you to switch between the search results while performing multiple searches. To create a new session, place the caret on an identifier and click the New Search icon. This will create a new tab filled with identifier references, keeping the previous search results untouched in a separate tab. To overwrite the search results in the current tab (session), place the caret on an identifier and click the Refresh icon.
The Find All References menu item, along with the Shift + F12 shortcut, refreshes the active session instead of creating a new one.