ReSharper 2016.1 Help

Navigation and Search in C++

ReSharper provides the following navigation and search features in C++:

Navigation by Name

ReSharper can bring you to any code item or file in a few keystrokes. The scope of the navigation includes symbols and files in your entire solution as well as all symbols and files in standard and libraries and external dependencies.

To navigate by name, invoke any of the commands mentioned in this section and start typing the name of the target item, its CamelHumps abbreviation, and/or wildcards. The list of matched items will narrow down as yuu type and the most probable candidates are shown closer to the top of the list.

As soon as the target item appears in the list, you can choose it to open it in the editor, or alternatively, you can click Show in Find Results go_to__show_in_find_results in the pop-up or press + on the numeric keypad to open all items in the list in the Find Results Window and use its features for further navigation (for more information, see analyzing search results).

The commands that navigate by name are described in the following topics:

Go to Declaration

This command allows you to navigate to the declaration of a symbol from any symbol usage. You can invoke this command from the editor, from the File Structure Window and other tool windows.
To navigate in the opposite direction (symbol usages) you can invoke the Go to Declaration command when you are already on the symbol declaration, or you can use the Go to Usages of Symbol command.

To go to symbol declaration, press Ctrl+B, choose ReSharper | Navigate | Go To Declaration in the main menu, or click the symbol holding down the Ctrl key.

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.

This command also works for typedefs. You can invoke this command from the editor, from the File Structure Window and other tool windows.

To navigate to the type of the symbol, Press Ctrl+Shift+T or choose ReSharper | Navigate | Type of Symbol in the main menu .

Go to Usages of Symbol

This command allows you quickly navigate to a specific usage of a symbol from its declaration or any other usage. You can invoke this command from the editor, from the File Structure Window and other tool windows. The opposite navigation is available with the Go to Declaration command.

The list of usages that you get with this command is the same as that of Find Usages. But this command is more convenient if you are looking for a specific usage and want to get to this usage without opening the Find Results Window.

You can configure ReSharper behavior for the cases when a single usage is discovered. By default, the usage is displayed in a pop-up. If you want ReSharper to jump tho the single usage in these cases, select the corresponding option (Go to Usage: if there is only one result, navigate without displaying the list) on the Options | Environment | Search & Navigation options page.

To go to usages of symbol, Press Ctrl+Alt+F7 or choose ReSharper | Navigate | Usages of Symbol in the main menu .

Go to Base Symbols

This command allows you to navigate up the inheritance hierarchy to a base type or method of the current symbol. You can invoke this command from the editor, from the File Structure Window and other tool windows.
Navigation in the opposite direction is available with the Go to Derived Symbols and Go to Implementation commands.

To navigate to base symbols, Press Ctrl+U or choose ReSharper | Navigate | Base Symbols in the main menu .

If a method overrides, implements, or hides another method, you can see it by the presence of a special icon (for example, gutter_icon_overrides) that appears to the left of the method declaration. Hover the mouse over this icon to see the base type for this method; click the icon to navigate up the methods hierarchy.

Go to Implementation

This command lets you jump from a base type or member to any of its end implementations, bypassing intermediate steps in the inheritance chain. In other words, it works similar to Go to Derived Symbols but it doesn't show abstract classes .

You can invoke this command from the editor, from the File Structure Window and other tool windows. If necessary, you can navigate in the opposite direction with the Go to Base Symbols command.

To navigate to implementations, Press Ctrl+Shift+Alt+B or choose ReSharper | Navigate | Go To Implementation in the main menu .

Go to Derived Symbols

This command gets the list of derived symbols for the current symbol and lets you navigate directly to one of them, down the inheritance hierarchy. There is a similar command, Go to Implementation, which lists only implementations, without intermediate steps in the inheritance chain.

To navigate to derived symbols, Press Ctrl+Alt+B or choose ReSharper | Navigate | Derived Symbols in the main menu .

Switching between header and source

For all symbols that have separate declarations and definitions, ReSharper displays the Navigate to declaration/definition ThemedIcon.Switch.Screen.[Gray] action indicator on the left. You can click on this indicator or press Alt+Enter to quickly switch between declaration and definition of the symbol.

There are more ways to switch between a header and the corresponding source file and vice versa:

  • Press Alt+O.
  • Press Ctrl+Shift+G or choose ReSharper | Navigate | Navigate To… in the main menu, and then select Switch Header/Source in the Navigate to pop-up.
  • Ctrl - click the symbol name.

Go to Primary Template/Specializations

If a class or function template has multiple specializations, ReSharper allows you to switch between the primary template/specializations.

When you caret is at the primary template or at one of the specializations, there are two ways of navigating between specializations:

  • Press Alt+Enter and choose Navigate to specializations ThemedIcon.Switch.Screen.[Gray] in the action list.
  • Press Ctrl+Shift+G or choose ReSharper | Navigate | Navigate To… in the main menu, and then select Specializations in the Navigate to pop-up.

In either way, a pop-up with all specializations appears where you can choose the desired one:

Navigating to specializations of a template

Find Usages

This command allows finding all usages of a specific symbol in the solution. You can start the search from the declaration of the symbol or from any other usage. You can invoke this command from the editor, from the File Structure Window and other tool windows.

If there are move than one usage, ReSharper helps you analyze the results in the Find Results Window.

If necessary, you can change the default behavior so that the single found usage is also displayed in the Find Results window. To do so, clear the Go to Usage: if there is only one result.... check box in the Environment | Search & Navigation options page.

To find usages of the current symbol, Press Alt+F7 or choose ReSharper | Find | Find Usages in the main menu .

Find Usages Advanced

This command enables you to find usages of entities that are somehow related to the selected symbol (for example, derived types, overriding methods etc.) in the specific scope. You can invoke this command from the editor, from the File Structure Window and other tool windows.

To find usages of the current symbol and related entities, Press Shift+Alt+F7 or choose ReSharper | Find | Find Usages Advanced… in the main menu .

Highlight Usages in File

If you are looking for usages of a symbol in the current document, it could be more convenient to highlight all usages and jump between then, rather than to analyze the usages in the Find Results Window. Note that read and write access usages are highlighted in different colors.

To find usages of the current symbol and related entities, Press Ctrl+Shift+F7 or choose ReSharper | Find | Highlight Usages in File in the main menu .

Go to Containing Declaration

With a single shortcut, ReSharper helps you quickly navigate to the declaration of a type or a function from any position within its body.

To go to containing declaration, Press Ctrl+[ or choose ReSharper | Navigate | Containing Declaration in the main menu .

Go to Next/Previous Member

Using these commands, you can quickly navigate between members and nested types in code files or between tags in markup files.

To invoke these commands, press Alt+Down / Alt+Up or choose ReSharper | Navigate | Next/Previous Member in the main menu.

Go to Related Files

This command can take you to all files whose contents are somehow related to the current file.

To go to related files, Press Ctrl+Shift+Alt+G or choose ReSharper | Navigate | Related Files… in the main menu .

Locate in Solution Explorer

This handy navigation feature lets you expand the tree in the Solution Explorer , auto-scroll and highlight the item corresponding to the current document. It is especially useful when you have a massive solution, or a limited screen area that forces you to shrink the Solution Explorer window to the limit.

To go to related files, press Shift+Alt+L or choose ReSharper | Tools | Locate in Solution Explorer in the main menu.

Navigating to Recent Locations

ReSharper keeps track of your actions and navigation history, and offers some commands that let you navigate to places where you have edited or just studied the code.

These commands are described in the following topics:

Viewing File Structure

With ReSharper, you can view the structure of the current document using the File Structure Window, which greatly simplifies navigation in large files. The window is synchronized with the editor. As you switch to another editor tab, the window displays the structure of the corresponding file.

Viewing file structure of a C++ file

Type Hierarchy

With ReSharper, you can investigate the inheritance hierarchy of types. You can see both base types and inheritors of the selected type and navigate to any of them with a mouse click. For more information, see Exploring Type Hierarchy

Type Hierarchy of C++ classes

Hierarchy of Includes

ReSharper allows you to visually analyze the hierarchy of includes for a single include directive or for a file.

To build the hierarchy of includes, set the caret to an #include directive in a file or select a file in the Solution Explorer, and then press Ctrl+Alt+H or choose ReSharper | Inspect | Hierarchies in the menu.

Hierarchy of C++ includes

You can double click on any file in the hierarchy to open it in the editor.

By default, child nodes of each file represent files included into this file, which corresponds to the Includee Reference__Windows__Type_Hierarchy_Window__Subtypes_Hierarchy mode on the toolbar. You can switch to the Includers Reference__Windows__Type_Hierarchy_Window__Supertypes_Hierarchy mode. In this mode, child nodes of a file represent files in the current scope that include this file.

Navigate to Action

ReSharper helps you quickly find and apply any of its actions, without digging through the menu. By an action, we mean an executable command available for the current caret position or any global command, e.g. a command that opens a tool window

To find and execute a ReSharper action, Press Ctrl+Shift+A or choose ReSharper | Navigate | Go to Action… in the main menu .

Bookmarks

For you custom navigation needs, ReSharper provides a way of marking code lines with bookmarks and navigating between them.

There are two types of bookmarks:

  • Numbered bookmarks - you can toggle each bookmark of this type and navigate to each of them with the dedicated shortcut: Ctrl+Shift+<digit> toggles the corresponding bookmark; Ctrl+<digit> navigates to the corresponding bookmark. You can have up to 10 numbered bookmarks simultaneously.
  • Anonymous bookmarks - these bookmarks can be only toggled and navigated from the bookmarks pop-up. You can have unlimited number of these bookmarks.

For more information, see Bookmarks

To-do Explorer

ReSharper provides an easy way to track tasks and technical debt in your code - code items (comments, string literals, or identifiers) matching a specific pattern can be easily located in the whole solution using a dedicated tool window.

For more information, see Using To-do Lists

Last modified: 19 August 2016