Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse editor show variable occurrence

Tags:

editor

eclipse

In Eclipse Standard Installation the editor marks all occurrences of a variable if you click on it with a cursor.

e.g. Setting the cursor somewhere on the 'foo' Variables it highlights all other foo's too.

public void printString(String foo){ System.out.println(foo); }

Any ideas where to switch this behavior on again or why the feature doesn't work ? I know the workaround is 'References->Workspace' but the auto highlighting is much more convenient.

like image 804
Martin Dürrmeier Avatar asked Aug 02 '10 12:08

Martin Dürrmeier


People also ask

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.

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 check reference variables in Eclipse?

Find all references with Ctrl + Shift + G , then filter in the Search view (results) via the View menu (dropdown triangle). You can select Reads there to filter these. Shortcut: Cursor to the variable, menu Search > Write Access > Workspace .

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.


2 Answers

You are asking about the "Toggle Mark Occurrences" the short cut for this is Alt + Shift + O

like image 157
Damian Leszczyński - Vash Avatar answered Oct 02 '22 05:10

Damian Leszczyński - Vash


You can also enable it from

Window > Preferences > Java > Editor > Mark Occurrences
like image 21
CodeBlue Avatar answered Oct 02 '22 05:10

CodeBlue