ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Go to Declaration

Last modified: 21 July 2022

ReSharper | Navigate | Go to Declaration

F12 (ReSharper_GotoDeclaration)

Use this command to navigate to the declaration of a symbol from any symbol usage. You can invoke this command from the Solution Explorer, 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.

By default, Go To Declaration works with Ctrl + left-click and with the middle button click. To disable this, clear the Rich mouse navigation in the editor checkbox on the Environment | Search & Navigation page of ReSharper options (Alt+R, O). You can also Ctrl+Shift-click usages of symbols to display their declarations in the Peek Definition view. If you want to disable this, clear the Use Ctrl+Shift click to open the result in the peek view checkbox.

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).

This feature is supported in the following languages and technologies:

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.