Eclipse doesn't highlight references anymore

Viewed 82032

I have an odd problem. In Eclipse Ganymede, I used to be able to highlight a variable, and it would highlight the use of that variables in that method. However through some action I have now disabled it. Is there a way I can enable it?

I tried searching Google, but since I don't know what the feature is called, its kinda tough.

Its a really useful feature, and its annoying that its not working.

11 Answers

There's a little "highlighter" icon on the toolbar - it toggles "Mark Occurrences".

From the preferences window, the feature you mean is configured by navigating to:

Window -> Preferences -> Java -> Editor -> Mark Occurrences

screen shot

There's a little "highlighter" icon on the toolbar - it toggles "Mark Occurrences".

You probably accidentally pressed it when trying to select a menu item at some point. I had a friend who did that with the "show selected element only" toolbar button...

You can either press it again or configure as Rytmis says.

Press alt-shift-O.

It toggles the "Mark Occurrences" feature of Eclipse; which provides the highlighting functionality you're missing.

In addition, you have to go to General->Editors->Text Editors->Annotations, choose Occurrences and check the "Text as" and choose Highlighted. This will make you happy.

To me it didn't work anymore because there was an error in the code. It generally works, but sometimes it might not, make sure your code has no errors if nothing else works.

Related