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.
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.
The Mark Occurrences feature enables you to see where an element is referenced by simply clicking on the element in the editor.
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 .
Ctrl + shift + a finds 'occurances in a file' that highlights all occurances of the selected text as you describe.
You are asking about the "Toggle Mark Occurrences" the short cut for this is Alt + Shift + O
You can also enable it from
Window > Preferences > Java > Editor > Mark Occurrences
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