There is a very useful functionality in eclipse: If you click on an element in the code (variable, type, method, etc.) it highlights all of its occurrences in the same file so you can find them with no pain.
But sometimes, due to some action you did by mistake, this functionality can be disabled. And now you don’t know how to reactivate it. Well, here are the solutions:
- Type on you keyboard alt-shift-o (windows) or opt-cmd-o (mac)
- or you can go to Window/Eclipse -> Preferences -> Java/Php -> Editor -> Mark Occurrences and then select what you want it to be highlighted.