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

View and edit related code in Peek Definition view

Last modified: 21 July 2022

Visual Studio's Peek Definition feature allows you to view and edit source code of a referenced symbol right on the spot, without opening another new tab.

ReSharper extends this feature making it even more handy:

  • Additionally to the Visual Studio's native shortcut, Alt+F12, you can Ctrl+Shift-click usages of a symbol to display its declaration in the Peek Definition view. If you want to disable this, clear the Use Ctrl+Shift click to Peek Declaration checkbox on the Environment | Search & Navigation page of ReSharper options (Alt+R, O).

  • All navigation features are available in the peek definition view. For example, you can invoke the Navigate To command Alt+`. All navigation results are shown within the same Peek Definition view.

  • If the Peek Definition view shows code from your solution, ReSharper performs code inspection and provides quick-fixes there:

    Code inspection in the peek definition view

    If you modify code, it is reanalysed automatically.

  • All refactorings are available in the Peek Definition view. You can press Ctrl+Shift+R to check the list of available refactorings.

  • You can close the Peek Definition view by pressing Esc and switch between the editor and the definition window by pressing Shift+Esc.

  • You can list and study implementations, base symbols, and usages of the symbol in thePeek Definition View.

To open different kinds of related sources in the Peek Definition view, you can set the caret at the desired symbol and type peek in the Go to Action popup Ctrl+Shift+A:

ReSharper: Choosing a navigation action for Peek Definition view