Find Usages for Apex code

You have an ability to find where else your Apex variable, class, method, etc. is being used, directly from the editor.

You can execute this search in 2 different ways:

  • with a hotkey Shift+F12 — to find the usages of the “item” that is located in the position of your caret,
  • using a context menu in the Apex Editor — just right-click on any “item” that you'd like to look for and select Find Usages.

Find Usages from the context menu

The results of the Find Usages action pops up in a new panel.

Find Usages Report

Here you can see all the references to the item you've looked for, grouped by files.

In each results entry you will find:

  • a type of construction where the search item was found: expression, method name, class name, etc (shown using an icon),
  • a location within a file in the format line:column,
  • a line of code where the item was found with the search item highlighted with a different background.

You can also double-click on any entry to be navigated to it directly in the editor.

Additionally, in the toolbar, you can find the following buttons that might help you navigating through the results faster.

Find Usages Report toolbar

  • Expand all — expands all groups (files) in the results list,
  • Collapse all — collapses all groups (files) in the results list,
  • Go to definition — does the same as a simple double-click — navigates you directly to the selected entry in the Apex editor,
  • Go to the previous location — navigates you to the previous result entry directly in the Apex editor,
  • Go to the next location — navigates you to the next result entry directly in the Apex editor,
  • Copy — copies the selected line of code to the clipboard,
  • Clear the current list* — clears results in the panel, * Cancel processing — cancels 'find usages' operation if you don't need results anymore.

    In this section:

    This also may be useful:**

Last modified: 2018/05/16 15:47

footer image