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

Eclipse Mark Occurrences的更多相关文章

  1. eclipse使用tips-Toggle Mark Occurrences 颜色更改

    Toggle Mark Occurrences这个功能非常好用,能把选中的方法/变量在本类中全部出现的地方高亮显示,是一个非常实用的功能.但是默认颜色是灰色,非常毁眼.可以通过下面的设置更改为自己喜欢 ...

  2. Eclipse 相同变量背景高亮显示设置(Occurrences)

    为了你们查看设置的简便,本次书写重点用图片说明.

  3. eclipse常用快捷键

    1. ctrl+shift+r:打开资源 这可能是所有快捷键组合中最省时间的了.这组快捷键可以让你打开你的工作区中任何一个文件,而你只需要按下文件名或mask名中的前几个字母,比如applic*.xm ...

  4. Eclipse 双击变量,其他相同变量有底色

    转载:http://blog.csdn.net/majian_1987/article/details/46691697 方便下次查找. 在Eclipse中,鼠标选中或者光标移动到Java类的变量名时 ...

  5. [No000077]打造自己的Eclipse

    下载官网的Eclipse IDE for Java EE Developers 在根目录下的eclipse.ini文件中添加"-Dfile.encoding=UTF-8", 作用: ...

  6. Eclipse设置选中高亮显示

    高亮显示选中的变量对于程序员编程很有帮助,正常情况下Eclipse选中变量时都会高亮显示,可能软件冲突导致高亮显示失效,通过如下方法可以进行恢复. 单击IDE顶部Window菜单下的Prefences ...

  7. 【转】Eclipse快捷键 10个最有用的快捷键

    转载地址:http://www.open-open.com/bbs/view/1320934157953 Eclipse中10个最有用的快捷键组合  一个Eclipse骨灰级开发者总结了他认为最有用但 ...

  8. 转:Eclipse快捷键 10个最有用的快捷键

    Eclipse快捷键 10个最有用的快捷键 Eclipse中10个最有用的快捷键组合  一个Eclipse骨灰级开发者总结了他认为最有用但又不太为人所知的快捷键组合.通过这些组合可以更加容易的浏览源代 ...

  9. Eclipse中10个最有用的快捷键组合

    Eclipse中10个最有用的快捷键组合 (转) 一个Eclipse骨灰级开发者总结了他认为最有用但又不太为人所知的快捷键组合.通过这些组合可以更加容易的浏览源代码,使得整体的开发效率和质量得到提升. ...

随机推荐

  1. 第10月第6天 lua 闭包

    1. static int mytest(lua_State *L) { //获取上值 )); printf("%d\n", upv); upv += ; lua_pushinte ...

  2. 第9月第30天 MVP

    1. import UIKit struct Person { // Model let firstName: String let lastName: String } protocol Greet ...

  3. 【转载】Maven pom文件详解

    什么是pom?    pom作为项目对象模型.通过xml表示maven项目,使用pom.xml来实现.主要描述了项目:包括配置文件:开发者需要遵循的规则,缺陷管理系统,组织和licenses,项目的u ...

  4. USB的挂起和唤醒(Suspend and Resume)【转】

    转自:http://m.blog.csdn.net/blog/luckywang1103/25244091 USB协议的第9章讲到USB可见设备状态[Universal Serial Bus Spec ...

  5. springcloud搭建服务注册中心与服务发现

    1.创建服务注册中心 创建一个普通的Spring Boot工程 首先我们需要创建一个普通的Spring Boot工程,命名为eureka-server,普通到什么程度呢?就是一个starter都不需要 ...

  6. Django Rest Framework-APIView源码分析

    class APIView(View): # The following policies may be set at either globally, or per-view. renderer_c ...

  7. 解决tomcat 启动 一闪而过

    有的朋友在启动Tomcat的时候会出现问题. 1例如: 手动点击startup.bat 后 ,一闪而过 2例如:在cmd下 进到tomcat的bin目录 运行 startup.bat ,然后输出 了J ...

  8. python包管理之Pip安装及使用

    Python有两个著名的包管理工具easy_install.py和pip.在Python2.7的安装包中,easy_install.py是默认安装的,而pip需要我们手动安装. pip可以运行在Uni ...

  9. linux(CentOS) 下mysql自动备份

    1.创建并编辑文件 /usr/sbin/bakmysql.sh,命令: vi /usr/sbin/bakmysql.sh 内容如下: db_user="root" db_passw ...

  10. 搭建项目vue + vue-router + vuex + vue-i18n + element-ui + egg + sequelize

    vue + vue-router + vuex + vue-i18n + element-ui + egg + sequelize https://www.cnblogs.com/wuguanglin ...