IntelliJ IDEA 13.1.0 Web Help

The search command Highlight Usages in File (Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Shift+Alt+O or Ctrl+Shift+F7Shift Command F7Shift Command F7Shift Command F7) makes it possible to visualize usages of a symbol in the current file. In particular, it is possible to highlight implemented methods of interfaces. All found usages of a symbol in the current file are highlighted and color-coded, as defined in the Colors and Fonts settings page, to represent read or write access to the symbol. In addition to the highlights of occurrences in text, the stripes of the same colors appear in the marker bar, accompanied with tooltips.

highlightUsages.png

The behavior of usage highlighting is configurable: you can make IntelliJ IDEA show usages of a symbol at caret automatically, or invoke it with a command.

This section describes how to:

8.0+
To configure highlight usages behavior
  1. Open the Settings dialog.
  2. In the Editor page of the IDE Settings, select the check box Highlight usages of element at caret to enable automatic usage highlighting.
To highlight usages of a symbol in the current file
  1. Place the caret at the selected symbol in the editor. If automatic usages highlighting is enabled, see all its occurrences in the current file highlighted. Otherwise, proceed to the next step.
  2. On the main menu, choose Edit | Find | Highlight Usages in File, or press Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Shift+Alt+O or Ctrl+Shift+F7Shift Command F7Shift Command F7Shift Command F7.
To highlight overridden methods
  1. In a class that implements one or more interfaces, place the caret at the implements keyword in the class declaration.
  2. On the main menu, choose Edit | Find | Highlight Usages in File, or press Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Ctrl+Shift+F7Shift+Alt+O or Ctrl+Shift+F7Shift Command F7Shift Command F7Shift Command F7. A list of implemented interfaces shows up:

    img

  3. Select the interface, whose methods you want to highlight, and press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.
To navigate among usages, do one of the following
  • Click on a stripe in the marker bar to navigate to the respective usage location.
  • Use F3 or Ctrl+LF3 or Ctrl+LF3 or Ctrl+LF3 or Ctrl+LF3 or Alt+SF3F3F3 or Ctrl+LCtrl+KCommand GF3 or Control LCommand K and Shift+F3 or Ctrl+Shift+LShift+F3 or Ctrl+Shift+LShift+F3 or Ctrl+Shift+LShift+F3 or Ctrl+Shift+LShift+F3, Alt+R or Ctrl+RShift+F3 or Ctrl+Shift+LShift+F3Shift+F3 or Ctrl+Shift+LCtrl+Shift+KShift Command GShift F3 or Control Shift LShift Command K keyboard shortcuts, to navigate to the next and previous usages respectively.
To remove highlighting of usages
  • Press EscapeEscapeEscapeEscapeEscape, Escape or Ctrl+GEscapeEscapeEscapeEscapeEscapeEscapeEscape.

See Also

Reference:

Web Resources: