Move through source code faster because fishing for code is a distraction that you don't have time for.
Advanced Code Navigation
The CodeRush's navigation engine makes it extremely easy to locate required code fragments. It contains dozens of navigation providers that
enable you to easily find related code elements and move from one element to another.
Follow these steps to start navigation:
- Place the cursor to the desired code element.
Choose the Jump To item from the context menu or simply press Shift+Alt+N to open the list of available navigation providers.
- Choose the needed navigation provider from the list.
When you're done, you can return to the initial position by simply pressing ESC (this collects the marker that is dropped when you start navigating).
You can also create shortcuts for frequently used navigation providers.
Here's the complete list of all navigation providers, i.e. ways to navigate code:
Supported Navigation Providers
|Can initialize conditionally||Jump to Abstract Member Ancestor||Jump to Ancestor
|Jump to Base Types||Jump to Base Types within Ancestors||Jump to Declaration
|Jump to Descendants||Jump to Enum Element||Jump to First Child
|Jump to First Enum Element||Jump to First Member||Jump to First Statement
|Jump to Flow Breaks||Jump to Implementations||Jump to Implementers
|Jump to Last Enum Element||Jump to Last Member||Jump to Last Statement
|Jump to Members||Jump to MVC Action||Jump to MVC Controller
|Jump to MVC View||Jump to Next Enum Element||Jump to Next Member
|Jump to Next Reference||Jump to Next Statement||Jump to Overloads
|Jump to Overloads within Ancestors||Jump to Overrides||Jump to Parent
|Jump to Parent Member||Jump to Parent Type||Jump to Previous Enum Element
|Jump to Previous Member||Jump to Previous Reference||Jump to Previous Statement
|Jump to Statements||Jump to Virtual Member Ancestor||
Markers are like breadcrumb trails for finding your way back to important points in your code. Markers offer a number of improvements over the basic bookmarks included with Visual Studio.
You can even use markers to work in two places at once (alternating between two important locations with a single keystroke), and you can also use them as visual reminders to unfinished code.
So while Visual Studio bookmarks are certainly useful, CodeRush markers may be a better alternative. Currently, markers are only available in CodeRush.
Visual Studio Bookmarks
|Visually marks a line for later visitation||Yes||Yes. VS bookmarks are drawn in the widget column, and are prone to being obscured by breakpoints and other widgets.
|Remembers column position ||Yes||No, the caret (editor insertion point) is always positioned at column 1.
|Remembers view position||Yes||No, bookmark is always centered vertically.
|Stack-based, allowing tracing of steps||Yes||No, bookmarks are navigated in line number order
|Move quickly between two locations||Yes||Only if the two locations are both in the active file (and there are only two bookmarks in that file).
Quick Navigation in CodeRush efficiently gets you where you need to be.
Quick Navigation is the member navigation feature of CodeRush that lets you jump straight to member declarations, with the advantage of live filtering (based on text you specify and other selectable criteria).
That's not all, Quick Navigation also includes an advanced code preview feature, so you can examine possible targets before you commit to a jump.
Finally Quick Navigation drops a marker at the point in your code that you jumped "from" so you can quickly return when you're finished at the target location.
Quick File Navigation
If your solution includes numerous files, Quick File Navigation greatly simplifies navigation through them.
By default, Quick File Navigation lists all files in a solution. The Filtering feature allows you to restrict this list to certain files. To do this, use the filter box to specify the search string, and then use the Up and Down keys to select the desired target. If you type uppercase characters in the filter, a special camel-case filtering mode will become active. Entries with uppercase characters matching those you've entered in the filter will appear. You don't need to specify all consecutive uppercase characters. Matched uppercase letters are red, while skipped uppercase letters are light blue.
CodeRush provides a fast and easy way to find and open recently edited files. Choose the File | Browse Recent Files item from the Visual Studio main menu to open the Recent Files window. The window can list more than 500 recently edited files. It may seem difficult to find a desired file among the variety of listed ones. Nevertheless, the Filtering feature greatly increases the search efficiency, restricting the list to certain files. The Recent Files window is identical to the Quick File Navigation window described in the previous paragraph.
If you have numerous files simultaneously opened in Visual Studio, some of them are hidden and cannot be accessed immediately. The Open Files window lists all open files and
enables you to quickly access each of them.
Hot bar to the left of a file name visually shows how long ago the file had been edited. It appears when a file has been saved and gradually decreases during the specified time span
The Open Files window includes filtering, which restricts listed files to certain files, satisfying a specified condition.
It can also group files by path or by project.
Click Identifier moves the caret to the declaration of the current identifier with a single click when Ctrl is pressed. CodeRush can also show the identifier declaration preview
hint, when the mouse pointer is over the identifier, provided that Ctrl is pressed.
Tab to Next Reference
Tab to Next Reference highlights all references, and enables you to navigate among them with ease. To activate the feature just place the caret inside an identifier, type reference, or
namespace, and press Tab or Shift + Tab.
Tab to Next Reference also enables you to quickly navigate within MVC projects. You can navigate among Razor code block identifiers,
or action and controller references, including references in string arguments passed to the ActionLink, Action, and RenderAction methods. Just place the caret inside an action or controller reference, and press the Tab key, as shown in the following video:
References tool window
The code of each solution is usually scattered in multiple files. And it is often difficult to track all usages of an identifier. CodeRush greatly simplifies tracking of identifier usages. It
shows all references to the selected identifier in the References window.
The left part of the window shows the references list as a tree repeating the solution structure. You can click a reference in a tree to see the code of the member that includes this reference.
Camel Case Navigation
Camel Case Navigation moves the cursor to the next or previous upper-case letter. The feature is activated by pressing ALT+RIGHT ARROW or ALT+LEFT ARROW.
Step Into Member
Step Into Member enables you to step into the member at the caret when debugging. This feature is especially useful when you encounter code like this while debugging:
Text = blackBox.Encode(GetFullName(FirstName, MiddleName, LastName));
If you want to step into blackBox.Encode without stepping into the property getters for FirstName, MiddleName, and LastName, and without stepping into the GetFullName function, just place the caret on the "Encode" member on the line, and press CTRL+SHIFT+F11.
The "Collapse to Projects" menu item
You can collapse the Solution Explorer tree items to projects. The Collapse to Projects item is built into the Solution Explorer context menu. Just click this menu item to collapse the tree items.