0

我是 php 开发的新手,想开始使用带有语法检查和自动完成功能的 IDE。我习惯于用 eclipse 编程 java,并认为 PDT 提供了类似的功能。

在 java 中,如果我输入例如:“new Arr”并按 ctrl+space 自动完成会建议顶部带有“new ArrayList()”的可能性列表。

但是如果我在 php 项目中尝试相同的操作,例如使用“new mysq”和 ctrl+space,我什么也得不到。我希望得到“new mysqli()”或类似的推荐。

PDT 中是否不包含所描述的功能?还是我配置错了什么?我做了“右键单击项目-> 配置-> 添加 php 支持”,但它没有改变任何东西。

4

2 回答 2

0

If you would like to have some basic auto complete feature you can use NotePad++ (download) for a quick and easy starter. This is a really great minimal program that can be used very efficiently to code in many different languages. It provides huge ammount of different functions. It is a must have tool for any developer.

I used Notepad++ to write ten thousands of lines of PHP code, it worked really great for me.

Otherwise PDT also supports autocomplete. Make sure that you have a PHP project added and then your are in a PHP file (.php extension). If you have Java autocomplete working in the same project then I think that you are in a Java project, try adding a PHP project, then a new PHP source file. Then PHP autocomplete should be working well in this source file.

Make sure also that you have PHP perspective selected.

I hope you can get by now starting using PHP! Have luck and good times using this great language!

Eclipse interface

于 2013-10-27T08:55:13.583 回答
0

我在这个问题中找到了解决方案:为什么 Eclipse 代码完成在某些项目上不起​​作用?

我不得不手动添加这个:

<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>

到我的项目的构建路径文件。

于 2013-10-28T10:50:28.967 回答