Highlight Usages in File
Edit | Find Usages | Highlight Usages in File
The editor automatically highlights usages of a symbol at caret, which is very convenient in short files and for locals in small contexts. However, this kind of highlighting does not always work well in larger contexts because the selection is only there as long as the caret stays at the symbol.
tip
To disable automatic highlighting, clear the Highlight usages of the element under cursor checkbox on the Editor | Inspection Settings page of JetBrains Rider settings CtrlAlt0S.
There is also a caret-independent highlighting that stays until you press Esc and applies different configurable colors to read and write access usages. You can toggle this highlighting for a single item or for several different items simultaneously, and then use shortcuts to jump between the highlightings.
Do one of the following:
To highlight usages of a symbol, place the caret at a declaration or a usage of this symbol.
To highlight usages of all types from an imported namespace, place the caret at the
using
directive (Imports
statement in Visual Basic) of this namespace.To highlight occurrences of a selected fragment, select this fragment.
Press or choose Edit | Find Usages | Highlight Usages in File from the main menu. Alternatively, you can press Ctrl0Q, start typing the command name in the popup, and then choose it there.
JetBrains Rider highlights read usages with blue and write usages with red. The colors are configurable.
If you started with a selection, found occurrences are highlighted the same way as for the Find command Ctrl0F.
The highlights are also duplicated with blue and red markers on the error stripe on the right. Checking these markers may be helpful if not all highlighted items are visible in the current frame.
To navigate between the highlighted items, choose Edit | Find | Find Next/Previous from the menu or press F3/ ShiftF3.
When you finish examining the highlights, press Esc to remove them.
Usages of a symbol:
![JetBrains Rider: Highlighting usages of a symbol in the current document JetBrains Rider: Highlighting usages of a symbol in the current document](https://resources.jetbrains.com/help/img/rider/2024.3/Navigation_and_Search__Finding_Usages__Highlighting_Usages_in_File.png)
Usages of all types from an imported namespace:
![JetBrains Rider: Highlighting usages of types form imported namespace JetBrains Rider: Highlighting usages of types form imported namespace](https://resources.jetbrains.com/help/img/rider/2024.3/highlight_usages_namespace.png)
Occurrences of a selection:
![JetBrains Rider: Highlighting usages of selected expression JetBrains Rider: Highlighting usages of selected expression](https://resources.jetbrains.com/help/img/rider/2024.3/highlight_usages_expression.png)
Press CtrlAlt0S to open settings and then select Editor | Color Scheme | General.
Expand the Search Results node and configure the following items:
Search result
Search result (write access)
Text search result