ReSharper 2016.2 Help

Finding Usages of External Symbols

ReSharper | Find | Find Symbols External to Scope
ReSharper_FindReferencedCode

ReSharper helps you find any outgoing references within a certain scope which can be as narrow as a function or as large as a project. Depending on the scope of the search, ReSharper will show you usages of all symbols defined outside of this scope. These may be symbols from your solution or symbols from compiled assemblies referenced in the current project.

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 of 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("denominator"); } }

If you run the command on a project, search results will include usages of symbols from referenced assemblies and usages of symbols from other projects in your solution, if any.

There are two ways to run the search for external symbols: if the scope is a project, a project folder, or a file, start the search from the Solution Explorer; if the scope is a class or a function, start the search from the editor.

To find usages of the symbols defined outside of the current scope

  1. Do one of the following:
    • Select a project, a project folder, or a file in the Solution Explorer.
    • In the editor, set the caret at a function or class.
  2. In the main menu, choose ReSharper | Find | Find Symbols External to Scope .
    If you are starting your search from the Solution Explorer, you can also right-click the selected item and then select Find Symbols External to Scope in the context menu.
    If you are starting your search from the editor, you can also press Ctrl+Shift+G and then select clickReferenced Code in the Navigate to menu.
  3. The search results appear in the Find Results Window, where you can further analyze the results.
ReSharper helps find code referenced from a project

See Also

Last modified: 15 December 2016