Eclipse Mark Occurrences
Mark Occurrences
The Mark Occurrences feature enables you to see where an element is referenced by simply clicking on the element in the editor.
When the Mark Occurrences feature is enabled, all occurrences of the element within the active file will be highlighted,
and indicators will be displayed in the annotations bar (to the right of the editor).
In addition, hovering over the element will cause a tooltip to be displayed with the location of all references of the element,
including occurrences of the element in other files.
Occurrences can be of 2 types -
“Write Occurrence” (for occurrences that are in a write mode) or
“Read Occurrence” (for occurrences that are in a read mode).
These will be highlighted in different colors according to the setting configured for PHP elements 'read' and 'write' occurrences
in the Annotations preferences page (Window | Preferences | General | Editors | Text Editors | Preferences).
Here you 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 will be highlighted can be configured in the
Mark Occurrences preferences page (Window | Preferences | PHP | Editor | Mark Occurrences ).
By default, the following types of elements are marked:
-
Method Exit - Exit points (throws / return / end of flow) of a method will be marked
-
Break / Continue - Scope (for, foreach, while, do-while or switch structure) of a break / continue statement will be marked
-
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 be done 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 an 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 is 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 you can do so in the
Preferences > General > Editors > Text Editors > Annotations
– look for“Occurrence annotation” and “Write occurrences”.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
2014-07-31 C++ 运算符优先级列表
2012-07-31 android 4.1 Emulator Skins
2012-07-31 stm32 sdio sdcard fatfs
2012-07-31 stm32 spi sdcard fatfs
2012-07-31 FATFS Copy Files