On this page:
- Activating automatic highlighting of usages
- Highlighting usages of a symbol in the current file
- Navigating among usages
- Removing highlighting
IntroductionPHP context, PhpStorm highlights extended and implemented methods, import statements, exit points, and the places where exceptions are thrown. Highlighting is invoked when you place the caret at an extends, implements, use, use trait, return, try, catch, or @throws keyword.
PhpStorm highlights usages of symbols with regard to their scope. For example, highlighting for @throws is not applied inside nested classes and functions.
All found usages of a symbol in the current file are highlighted and color-coded, as defined in the Color Scheme 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.
The behavior of usage highlighting is configurable: you can make PhpStorm show usages of a symbol at caret automatically, or invoke it with a command.
Activating automatic highlighting of usages
- Open the Settings/Preferences dialog box ( for Windows and Linux or for macOS), and click General under the Editor node.
- On the General page that opens, select the Highlight usages of element at caret check box in the Highlight on Caret Movement area.
Highlighting usages of a symbol in the current file
- 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.
- On the main menu, choose , or press Ctrl+Shift+F7.
Navigating among usages
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 the F3 and Shift+F3 keyboard shortcuts to navigate to the next and previous usages respectively.
To remove highlighting of usages, press Escape.