Marking occurrences of code elements

The mark occurrences action in the editor locates related language elements in the editor. If Mark Occurrences is enabled, you can select an element in the code and other instances are highlighted.

Before you begin

  1. To define the language elements that are highlighted by the Mark Occurrences action, use the Mark Occurrences preference.
  2. Ensure that the Mark Occurrences action is enabled in the editor toolbar.
If you want to disable the Mark Occurrences action, clear Mark Occurrences in the editor toolbar. This action is enabled by default.

About this task

The Mark Occurrences and Search Occurrences actions are similar in that both provide a method to locate related language elements. But they have several differences:
  • Results of a search occurrences operation are included in the Search view along with being highlighted in the editor. The results of a mark occurrence action are included in the editor only.
  • The results of a search occurrences operation include occurrences in copy members, include members, and identified preprocessor statements. These occurrences are not provided in the mark occurrence results.
  • The mark occurrence action is limited to elements selected on the Mark Occurrences preference.

Procedure

Focus the cursor on an element.
Other instances of the elements are highlighted as follows:
  • Write instances are highlighted in orange.
  • Read instances are highlighted in gray.