ReSharper 2022.1 Help

Go to Type of Symbol

While the Go to Declaration command navigates you to the place where a symbol is declared, the Type of Symbol command navigates to the declaration of the type of the currently selected symbol. For example, if you have a variable Foo myVar = new Foo(); and invoke this command on a usage of myVar, it will bring you to the declaration of the class Foo. If you invoke this command on a function, it navigates to the function's return type.

For variables of generic types, this command allows you to navigate to the generic type declaration as well as to declarations of all generic parameters. For example, suppose you have a type class MyGeneric<X, Y> and a variable of this type var myGeneric = new MyGeneric<Author, Book>();. Invoking this command on any usage of myGeneric, you will be able to choose the navigation destination between MyGeneric, Author, and Book classes.

You can invoke this command from the Solution Explorer, from the File Structure window and other tool windows.

Navigate to the type of a symbol

  1. Place the caret at a symbol in the editor or select the symbol in a tool window.

  2. Press Control+Shift+T or choose ReSharper | Navigate | Type of Symbol from the main menu . Alternatively, you can press Control+Shift+A, start typing the command name in the popup, and then choose it there.

  3. If the command returns a single result, ReSharper navigates directly there. In case of several declarations (for example, in a partial class), they will be listed in a drop-down where you can do one of the following:

    • Click the desired item to open it in the editor.

    • Select the desired item by pressing Up and Down and then press Enter to open it in the editor.

    • To view and analyze the list of matched items in the Find Results window, click Show in Find Results Themed icon search results screen gray, press Shift+Enter or + on the numeric keypad .

If the item you navigate to belongs to the current solution, ReSharper opens the corresponding file in the editor and places the caret at the symbol declaration. If it is in referenced libraries, ReSharper navigates according to the settings defined on the Tools | External Sources page of ReSharper options (Alt+R, O).

When you invoke Go to Type of Symbol on a variable or parameter of an interface type in debug mode, ReSharper will get you to its exact implementation that is used in the current frame instead of the interface declaration.

If Enable property evaluation and other implicit function calls is selected on the Debugging | General page of Visual Studio's options, then navigation to the implementation will also work on properties that hold the interface type.

interface IMyInterface { public void Print(); } class One : IMyInterface { public void Print() => Console.WriteLine("One"); } class Two : IMyInterface { public void Print() => Console.WriteLine("Two"); } class Test { void Test1() => MyTest(new One()); void Test2() => MyTest(new Two()); void MyTest(IMyInterface input) { // 'Go to Type of Symbol' on 'Print()' will navigate to // 'One' or 'Two' // depending on the debugger context. input.Print(); } }

This feature is supported in the following languages and technologies:

Language: C#

Language: VB.NET

Language: C++

Language: HTML

Language: ASP.NET

Language: Razor

Language: JavaScript

Language: TypeScript

Language: CSS

Language: XML

Language: XAML

Language: Resx

Language: Build Scripts

Language: Protobuf

Language: JSON

Feature is available in C#

Feature is available in Visual Basic .NET

Feature is available in C++

Feature is not available in HTML

Feature is available in ASP.NET

Feature is available in Razor

Feature is not available in JavaScript

Feature is available in TypeScript

Feature is not available in CSS

Feature is not available in XML

Feature is available in XAML

Feature is not available in Resource files

Feature is not available in build script files

Feature is not available in Protobuf

Feature is not available in JSON

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by language section.

Last modified: 24 May 2022