Eclipse Tip: Mark Occurrences


Eclipse has a feature to visually see all occurrences of a method, variable or method exit points. Use the mark occurrences icon shown on the left to toggle this feature. Once enabled select a method or variable. Eclipse will highlight all occurrences of this in the current file. Select a return type to highlight all the exit points of a method.

Vasanth Dharmaraj is a Java Architect currently working for Western Union living in the Bay Area. He is interested in programming, gadgets, formula one... You can follow him on Twitter.

Posted in Eclipse, Java
5 comments on “Eclipse Tip: Mark Occurrences
  1. One of my favourite Eclipse features. And they even spelled "occurrences" correctly!

  2. Leandro Paradelo says:

    This feature has even more interesting options. Besides selecting the return type and marking all exit points of the method it INCLUDES marks on all method calls that throws exceptions not caught!
    And last but not least, if you select an exception (i.e. in the catch clause) it marks all function that can throw such an exception, including exceptions in the same path of the class hierarchy!
    Amazing!
    Leandro Paradelo.

  3. Vasanth says:

    Leandro Paradelo,

    Thanks for the additional information. It is a neat feature.

  4. Andrew says:

    This has a key binding, ALT + SHIFT + O

    Very useful to toggle this quickly!

  5. Vasanth says:

    Thanks for the tip Andrew.

Ads By Google