Navigate current context
dotPeek provides a number of features that help you navigate your code based on the current context, that is according to the opened document and your caret position inside it.
Windows | File Structure
CtrlAlt0F
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. To navigate through the file easily, preprocessor directives are hidden by default.
tip
To list file members using a popup instead of a tool window, press Alt|
Press CtrlAlt0F or choose Windows | File Structure from the main menu . Alternatively, you can press CtrlShift0A, start typing the command name in the popup, and then choose it there.
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.
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
on the toolbar.
To synchronize symbols that you select in the File Structure window with the caret position in the code viewer, click Automatically Scroll to Source
on the toolbar.

Right from the File Structure window, you can access even more actions. To check available commands, you can right-click any symbol.
To open a specific type or member in the code viewer, double-click it or press Enter or Ctrl+Enter.
Find usages of symbols ShiftF12
tip
To search items in the File Structure window, just start typing a name or a CamelHumps abbreviation.
Control | Name | Description |
---|---|---|
| Expand All/Collapse All | Expands/collapses all nodes in the current tab. |
| Previous/Next Shift+F8 / F8 | Navigate to the previous/next item and scrolls through the source code accordingly. |
Export | Click this button to export the data currently displayed in the window in text format , or use the drop-down selector to export the data in an XML or HTML format. The Export Data dialog that appears will help you save the data to a file or copy it to the clipboard . | |
Track Caret in Editor | When this button is pressed, items in the window are highlighted according to the position of the caret in the code viewer. | |
Automatically Scroll to Source | When this button is pressed, the code viewer opens the file and scrolls it according to the items selected in the window. | |
Show Preprocessor Directives | In C++, shows all preprocessor directives in the current file. |
Navigate | Containing Declaration
Ctrl0[
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.
tip
dotPeek provides a related feature — Select Containing Declaration (CtrlShift0[) .
Set the caret into any position within the body of a type or a function.
Press Ctrl0[ or choose Navigate | Containing Declaration from the main menu . Alternatively, you can press CtrlShift0A, start typing the command name in the popup, and then choose it there.
dotPeek will set the caret to the declaration of the type or function.
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
Alt0↓ / Alt0↑
With the Next/Previous Member commands, you can quickly navigate between members and nested types in code files or between tags in markup files.
When your focus is in the editor, press Alt0↓/Alt0↑ or choose Navigate | Next/Previous Member in the main menu.
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.
Navigate | Locate in Assembly Explorer
ShiftAlt0L
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.
tip
You can also locate a library symbol in the Assembly Explorer right from the source code where this symbol is used: While your caret is on the symbol, press or choose from the main menu , and then select Locate in Assembly explorer.
In the code viewer, set the caret to a symbol that you would like to locate in Assembly Explorer.
Press ShiftAlt0L or choose Navigate | Locate in Assembly Explorer in the main menu,
dotPeek will bring up the Assembly Explorer window to focus and show you the item there.
Navigate | Related Files
CtrlAltF7
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.
Place the caret within a file .
Press CtrlAltF7 or choose Navigate | Related Files from the main menu . Alternatively, you can press CtrlShift0A, start typing the command name in the popup, and then choose it there.
If there are some related files, the Select File list opens. Select a file from the list and click it to open it in the editor.
The Go to Line command lets you quickly jump to any line of code in the current document.
tip
To display line numbers in the code viewer, press Ctrl+R,N or choose View | Options | Line Numbers. in the menu.
Press Ctrl+G or choose View | Go to Line from the menu.
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.
