dotPeek 2019.2 Help

Navigating Current Context

dotPeek provides a number of features that help you navigate the structure of your code based on the current context, that is the opened document and your caret position inside it.

Windows | File Structure
Ctrl+F11

With dotPeek, you can navigate the structure of the current document using the File Structure window, which greatly simplifies navigation in large files. The window is synchronized with the code viewer: as you switch to another code viewer tab, the window displays the structure of the corresponding file.

  1. Press Ctrl+F11 or choose Windows | File Structure from the main menu. Alternatively, you can press Ctrl+Shift+A, start typing the command name in the popup, and then choose it there.

  2. Contents of the current document appear in a tree structure, that you can explore and navigate through the document. You can double-click any symbol to make the caret in the code viewer switch to the corresponding position.

  3. To synchronize the way you change caret position in the code viewer with the symbol highlighted in the File Structure window, click Track Caret in Editor ThemedIcon SyncCaretToView Screen Gray on the toolbar.

  4. To synchronize symbols that you select in the File Structure window with the caret position in the code viewer, click Automatically Scroll to Source ThemedIcon SyncViewToCaret Screen Gray on the toolbar.

Right from the File Structure window, you can access even more actions. To check the available commands, you can right-click any symbol.

Navigate | Containing Declaration
Ctrl+[

With a single shortcut, you can jump in the editor to the declaration of a type or a function from any position within its body.

  1. Set the caret into any position within the body of a type or a function.

  2. Press Ctrl+[ or choose Navigate | Containing Declaration from the main menu. Alternatively, you can press Ctrl+Shift+A, start typing the command name in the popup, and then choose it there.

  3. dotPeek will set the caret to the declaration of the type or function.

  4. If the type or function is declared within another type, you can repeat step two to navigate to the declaration of the containing type.

Navigate | Next/Previous Member
Alt+Down/Alt+Up

With the Next/Previous Member commands, you can quickly navigate between members and nested types in code files or between tags in markup files.

  1. When your focus is in the editor, press Alt+Down/Alt+Up or choose Navigate | Next/Previous Member in the main menu.

  2. The caret will move to the declaration of the next/previous member/tag. If there are inner types, the caret will also stop at each inner type's member.

Locating current document in Solution/Assembly Explorer

Navigate | Locate in Assembly Explorer
Shift+Alt+L

This handy navigation feature lets you expand the tree in the Assembly Explorer window, auto-scroll and highlight the item corresponding to the current document.

If the cursor is on a specific symbol, the item corresponding to this symbol is highlighted in the Assembly Explorer; if the cursor is elsewhere in the document, the root type of the document is highlighted.

  1. In the Code Viewer, set the caret to a symbol that you would like to locate in Assembly Explorer.

  2. Press Shift+Alt+L or choose Navigate | Locate in Assembly Explorer in the main menu,

  3. dotPeek will bring up the Assembly Explorer window to focus and show you the item there.

Navigate | Related Files…
Ctrl+Shift+Alt+G

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

Navigating to related files may be very useful for web applications: for example, it enables you to jump from a web form to its master page, user controls, referenced images or JavaScript and CSS files. In ASP.NET MVC applications, it simplifies navigation from views to controllers and back.

  1. Place the caret within a file.

  2. Press Ctrl+Shift+Alt+G or choose Navigate | Related Files… from the main menu. Alternatively, you can press Ctrl+Shift+A, start typing the command name in the popup, and then choose it there.

  3. If there are some related files, the Select File drop-down list opens. Select a file from the list and click on it to open it in the editor.

    dotPeek: navigating related files

View | Go to Line
Ctrl+G

The Go to Line command lets you quickly jump to any line of code in the current document.

  1. Press Ctrl+G or choose View | Go to Line from the menu.

  2. In the dialog that appears, you will see the total number of lines in the current document. The target line is set to the current line. Type the target line number and then click OK.

Last modified: 11 July 2019

See Also