Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Fix "Mark Occurrences" in Eclipse?

Tags:

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?

like image 519
machineghost Avatar asked Jul 30 '09 21:07

machineghost


People also ask

What is Toggle mark occurrences eclipse?

The Mark Occurrences feature enables you to see where an element is referenced by simply clicking on the element in the editor.

How do you highlight occurrences in eclipse?

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.

How do I select all occurrences of a word in eclipse?

Ctrl + shift + a finds 'occurances in a file' that highlights all occurances of the selected text as you describe.

How do you mark occurrences?

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.


2 Answers

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...

like image 54
Kawu Avatar answered Sep 17 '22 03:09

Kawu


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

like image 30
laurie Avatar answered Sep 20 '22 03:09

laurie