Find References

  • 3 minutes to read

CodeRush includes Tab to Next Reference and References window features that help you find references to a selected type or identifier.

Tab to Next Reference

Tab to Next Reference allows you to jump between references to a selected identifier or type. This feature works in C#, Visual Basic, JavaScript, TypeScript, CSS, XAML, and Blazor code. The following screencast shows Tab to Next Reference in Blazor:

Nav_Tab2NextRef

How to Use

  • Place the caret in an identifier or type and press Tab.

    CodeRush underlines all references and moves the caret to the next one.

    Nav_Tab2NextRef

  • Press Tab again, if the next reference is not the one you are looking for. You can press Tab multiple times until you reach the desired reference.

When you reach the last reference, press Tab to navigate to the first instance.

  • Press Shift+Tab to navigate to the previous reference.

  • Press Esc to navigate back to the start position and remove underlines from references.

Nav_Tab2NextRef

NOTE

Tab to Next Reference searches for references in the entire solution. If CodeRush finds the next reference in the closed file, it opens this file and places the caret to the found reference.

References Window

The References window shows references found in the solution and allows you to navigate through results.

Search for References

  • Place the caret in an identifier or type in a cs, vb, ts, js, ts, css, xaml, or razor file.

  • Open the References window.

Press Shift + F12 or choose CodeRush | Navigate | Find All References menu item.

OpenWindow

The References window shows references to a selected identifier or type.

Nav_RefWindow

The References window supports the following operations.

  • Press F8 to navigate to the next item.

  • Press Shift + F8 to navigate to the previous item.

The References window shows the surrounding code for a selected item in the preview and code editor.

RefWindow

Group Items

CodeRush can group references by any combination of the following entities:

  • Project
  • Directory
  • File
  • Namespace
  • Type (class, interface, etc.)
  • Member

The image below shows Project, Directory, and Type nodes in the References window.

OpenWindow

Filter by Operation Types

CodeRush allows you to filter items by the following operation types:

  • Read
  • Write
  • Instantiations (New Instances)
  • All

The image below shows the selected Write item in the toolbar's drop down box to filter items by writes.

Write

Filter by Text

Enter text in the search box to remove items that do not contain that text within their entry.

The image below shows items filtered by the word "parse".

FilterByText

Multiple Sessions

The References window supports sessions that allow you to switch between the search results when CodeRush performs multiple searches.

Place the caret in an identifier and click the New Search button to create a new session.

CodeRush creates a new tab filled with identifier references and keeps the previous search results untouched in a separate tab.

Sessions

Refresh Results

CodeRush can overwrite the search results in the current tab (session).

Place the caret in an identifier and click the Refresh button.

Sessions

NOTE

CodeRush refreshes the active session when you reopen the References window.