One of the features I really like about Netbeans is that when you click on a variable, method, field etc. Netbeans shows you all the usages of this entity in the right hand bar as little bars of colour. Is there a way to get this behaviour in IntelliJ IDEA and if so, how do I turn it on? I haven't found anything in the settings or Google but I might be missing something!
Highlighting a variable or subfunction usage is easy, just click on any variable or subfunction name in the editor, and after a brief pause, all the usages of that variable or subfunction will be highlighted in light blue.
Enable semantic highlightingPress Ctrl+Alt+S to open the IDE settings and select Editor | Color Scheme | Language Defaults | Semantic highlighting. Select the Semantic highlighting checkbox and customize the color ranges if necessary.
IntelliJ IDEA allows you to inspect variables in a dedicated dialog. This is useful when you need to keep track of some variable (or the object whose reference it holds) and at the same time be able to navigate between frames and threads. Right-click a variable on the Variables tab and select Inspect.
Apart from enabling the "automatic highlight usages" setting described above, you can also invoke "highlight usages" manually, using the shortcut Ctrl+Shift+F7.
The benefits of using the "manual" highlight usages are:
file>settings
or ctrl+alt+s
(for windows) select editor from the list on the left and check Highlight usages of element at caret
in the Highlight on Caret Movement
section
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With