Find referenced code
Navigate | Navigate To | Referenced Code
Alt0` | Referenced Code
This command helps you find any outgoing references within a certain scope, which can be as narrow as a function or as large as a project.
This command comes in handy when you are going to move a class or a method to another place. You will be able to use the list of outgoing references to estimate additional changes that the move will require.
tip
To find usages of symbols from a specific module referenced in your project, use the Find Dependent Code command.
Consider the ExternalSymbols
class below. If you run the command on the constructor, the search result will be a single usage of the method Divide
, because it is defined outside the constructor. If you run the command on the class, the search result will be the usage of System.ArgumentOutOfRangeException
, because the rest is defined inside the class.
class ExternalSymbols // Symbols external to the class: System.ArgumentOutOfRangeException
{
ExternalSymbols() // Symbols external to the constructor: MyProject.ExternalSymbols.Divide
{
var x = Divide(10,2);
}
private int Divide(int numerator, int denominator)
{
if (denominator != 0)
return numerator/denominator;
throw new ArgumentOutOfRangeException(nameof(denominator));
}
}
Place the caret at a function or a class.
PressAlt0` or choose Navigate | Navigate To… from the main menu, and then select Referenced Code in the Navigate To menu.
The search results appear in the Find window, where you can further analyze the results.
![JetBrains Rider: Finding external usages of symbols in the selected scope JetBrains Rider: Finding external usages of symbols in the selected scope](https://resources.jetbrains.com/help/img/rider/2024.3/cookbook_dependencies2.png)