Mark occurrences
The Mark occurrences feature enables where an element was referenced by simply clicking on the element in the ED Itor.
When the Mark occurrences feature was enabled, all occurrences of the element within the active file would be highlighted,
And indicators'll is displayed in the annotations bar (to the right of the editor).
In addition, hovering over the element would cause a ToolTip to being displayed with the location of all references of the ele ment,
Including occurrences of the element in other files.
Occurrences can be of 2 types-
"Write occurrence" (for occurrences that is in a write mode) or
"Read occurrence" (for occurrences that is in a read mode).
These'll be highlighted in different colors according to the setting configured for PHP elements ' read ' and ' write ' OCCU Rrences
In the Annotations Preferences page (Window | Preferences | General | Editors | Text Editors | Preferences).
Here's can also configure the indicators used in the vertical ruler/marker bar (to the left of the editor)
and the Annnotations bar (to the right of the editor).
The types of elements whose occurrences'll be highlighted can is configured in the
Mark Occurrences Preferences page (Window | Preferences | PHP | Editor | Mark occurrences).
By default, the following types of elements is marked:
Method Exit-exit points (Throws/return/end of flow) of a method would be marked
Break/continue-scope (for, foreach, while, do-while or switch structure) of a break/continue statement would be Marke D
Local variables
Global variables
Parameters
Functions
Methods
Fields
Class Constants
Constants (defined)
Class/interface
HTML Tags
You'll want to change the "occurrences" and "Write occurrences" colors.
This can do in the Annotations menu, which is located-
As Colin said-in the Preferences menu under the path
General > Editors > Text Editors > Annotations
If you have a occurrence marked in the overview ruler (the column to the right of the scrollbar),
You can open the Annotations menu directly by right-clicking on the occurrence and selecting Preferences from the context Menu.
The color of "occurrences" is used for instances where the variable are being read, but not modified,
In the code (e.g. k
in if(k > 1)
).
The color of "write occurrences" is used where the variable gets modified/written to
In the code (e.g. k
in k = k + 1
).
If you want to change the default highlight colours the
Preferences > General > Editors > Text Editors > Annotations
–look for"Occurrence annotation" and "Write occurrences".
Eclipse Mark Occurrences