简体   繁体   English

如何在Eclipse PHP中找到工作区中的引用(ctrl + shift + g)?

[英]How to find references in workspace (ctrl+shift+g) in Eclipse PHP?

I'm using Eclipse PDT, and I have opened my project in PHP, the auto-complete works, the type searching works, but what doesn't work is if I click the name of the function and press Ctrl + Shift + G it doesn't return other references to that function in the workspace. 我正在使用Eclipse PDT,我已经用PHP打开了我的项目,自动完成工作,类型搜索工作,但是如果我单击该功能的名称并按Ctrl + Shift + G它不起作用不会在工作区中返回对该函数的其他引用。

I'm familiar with Java + Eclipse, and doing this in Java brings up a search of all calls to that function in the workspace. 我熟悉Java + Eclipse,在Java中执行此操作会在工作区中搜索对该函数的所有调用。 I'm brand new to PHP, so is there something wrong? 我是PHP的新手,所以有什么不对吗? Does PHP not "reference" things like in Java? PHP不会像Java一样“引用”这些东西吗?

(Note: I did set up the Ctrl + Shift + G key binding to Find references in workspace) (注意:我确实设置了Ctrl + Shift + G键绑定到工作区中的查找引用)

PHP is a dynamic scripting language. PHP是一种动态脚本语言。 This also means it's very hard to determine the types of the elements in the code, and in some cases, impossible in 'design-time'. 这也意味着很难确定代码中元素的类型,在某些情况下,在“设计时”中是不可能的。 This is one of the main reasons products like PDT and Aptana Studio highly rely on the PHPDoc to provide accurate code assist and type-binding. 这是PDT和Aptana Studio等产品高度依赖PHPDoc提供准确的代码辅助和类型绑定的主要原因之一。

It's very different from Java by nature, so finding references, refactoring, and other advanced features you are familiar with in the Java Plugin, are missing in the PDT. 它本质上与Java非常不同,因此在PDT中缺少您在Java插件中熟悉的参考,重构和其他高级功能。

Some of those do exist in other products. 其中一些确实存在于其他产品中。 For example - refactoring in Zend Studio, and 'code exploration' in nWire for PHP. 例如 - 在Zend Studio中重构,在nWire for PHP中进行“代码探索”。 Those product cost money... 那些产品要花钱......

Hope that helps. 希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM