Highlight Exceptional Throwers in IntelliJ IDEA

I recently migrated from Eclipse to IntelliJ IDEA, and there is a feature that I am missing. In Eclipse, when you put a caret on a checked exception, in the throws declaration or catch block, highlight which method / constructor calls raise this exception.

Is there a way to do this in IntelliJ IDEA (Community edition)?

+69
java eclipse intellij-idea
Oct 14 '11 at 21:17
source share
1 answer

Place the caret on the catch keyword and press Ctrl + Shift + F7 .

( Find | Highlight Usages in File ). If you use a different keyboard layout and the above shortcut does not work, use Help | Find Action to find this action and see its key combination:

Find action

If you want it to work automatically, enable Settings | Editor | Highlight usages of element at caret .

The same thing works with the try and throws keywords with a selection of exceptions to highlight.

Here is a screenshot from IntelliJ IDEA Tip of the Day:

exceptions highlighted

Note that there is no way to highlight it with a specific exception class until you select this class from the list of sentences:

exceptions to highlight

+72
Oct 14 '11 at 10:26
source share



All Articles