Eclipse is a great editor, and among it's many wonderful features one of my favorites is the Mark Occurrences feature. However, I recently installed the Aptana plug-in, and in trying to configure it I somehow managed to break Mark Occurrences in my Eclipse installation.
The feature still works somewhat, but instead of highlighting all occurrences of a given object, it now only highlights the occurrence where it is first created. In other words, in:
1. Dog dog = new Dog(); 2. dog.bark(); 3. dog.bark();
Only the "dog" in line 1 would be highlighted, not the "dog" in 2 or 3.
However, before I know I had things configured such that all three "dog" references would be highlighted by Eclipse. Does anyone know what configuration option I changed to "break" the marking of occurrences like this?
The Mark Occurrences feature enables you to see where an element is referenced by simply clicking on the element in the editor.
Glance does not work anymore, but in current Eclipse Versions (Eclipse 2020) you can highlight any word by selecting the word and pressing CTRL+F.
Ctrl + shift + a finds 'occurances in a file' that highlights all occurances of the selected text as you describe.
To configure Mark Occurrences preferences: Mark the 'Mark occurrences of the selected element in the current file' checkbox to enable the Mark Occurrences functionality. Configure the elements for which the Mark Occurrences feature will be enabled by marking the relevant checkboxes.
If the option mentioned by laurie is checked and you're wondering why it isn't working, you might have hit Alt-Shift-O sometime:
Cannot highlight all occurrences of a selected word in Eclipse
Note, that "Organize Imports" has Ctrl-Shift-O...
Check the following preference setting:
Preferences > General > Editors > Text Editors > Annotations
In here compare the settings for Occurrences and Write Occurrences.
You probably don't have the Text as higlighted option checked
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