Skip to main content

Markers

  • 3 minutes to read

Markers are navigation waypoints which save the important locations in the code to which you can return in the future.

Note

You can configure Markers on the Editor | All Languages | Markers options page. See Marker Settings for more information.

How to Enable

Open the Configuration Options window, choose the Editor | All Languages | Markers options page, and enable the corresponding option.

Options

or

Click the Setup Wizard… item in the CodeRush menu to open the wizard (see First Steps for more information) and choose one of the “use markers” options in the Markers wizard page.

Markers

Drop a Marker

CodeRush can drop a marker if you enable the Markers feature for the following cases:

Features that take you to a newly-generated code (for example, Move Type to File, Declare Class, etc.). The screenshot below shows the dropped marker for the generated “Customer” class:

Provider

When CodeRush expands a template (if one of the marker text commands is inserted into the template expansion code). You need to enable the “Drop markers in templates” option. The following screencast shows the “c” template expansion:

Expand Template

When CodeRush executes a refactoring (if the caret position is changed). The following screenshot shows the dropped marker after CodeRush executes the Declare Partial Class Part refactoring:

Refactoring

When CodeRush drops a marker before jump after you run one of the Jump To navigation providers, or use the built-in Visual Studio’s Edit.GoToDefinition (F12) or Edit.GoToReference (Ctrl+F12) command. You need to enable the corresponding marker option

Before Jump

CodeRush also allows you to drop a marker. Place the caret in code where you want to drop a marker, and perform one of the following actions:

  1. Press Alt+Home.

    Drop Manually

  2. Use the CodeRush | Navigate | Drop Marker menu item.

    Menu

You can also perform one of the actions above to drop a marker onto the selected code.

Menu

The sections below describe ways you can use to navigate to the last dropped marker.

Collect a Marker

Place the caret in the code editor and perform one of the following actions:

  1. Press AltEnd.

  2. Press Esc.

  3. Use the CodeRush | Navigate | Collect Marker menu item.

CodeRush moves the caret to a marker and removes it. If several markers are dropped, they are collected sequentially starting with the most recent.

Collect

You can specify which shortcut CodeRush should use to collect a marker:

  1. Open the CodeRush setup wizard (see First Steps for more information).

  2. Go to the Markers wizard page and choose one of the “Use markers and collect..” options.

    Markers

Collect a Marker and Paste

This command collects a last dropped marker and pastes clipboard contents in its place.

Place the caret in the editor and perform one of the following actions:

  1. Use the CodeRush | Navigate | Collect Marker And Paste menu item.

  2. Press Shift+Esc.

    Paste

Swap a Marker

CodeRush can drop a marker and collect the last dropped marker.

Place the caret in code where you want to swap a marker and perform one of the following actions:

Use the CodeRush | Navigate | Swap Marker menu item. Press Alt+Shift+Home.

Swap

Clear All Markers

Use the CodeRush | Navigate | Clear All Markers menu item to clear all markers simultaneously.

Swap

Change Default Shortcuts

  1. Use the CodeRush | Shortcuts… menu item to access the IDE | Shortcuts options page.

    Config_Shortcuts_Access

  2. Open the Navigation | Markers group, select the command and change the default shortcut for it. See the Shortcuts topic for more information.

    Shortcuts