Eclipse PDT + 代码完成根本不起作用 [英] Eclipse PDT + Code completion not working at all

查看:43
本文介绍了Eclipse PDT + 代码完成根本不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开始一个新的 Zend 项目,目前我正面临一些有关 Eclipse PDT 的问题……我的问题是,Eclipse 中的 PHP 代码补全功能根本不起作用.

我尝试了很多不同的教程等,例如创建一个新项目并导入文件;创建一个新的工作区并在那里导入项目;几乎所有可能的构建路径设置和库导入组合;删除 .metadata 中的几个文件(如果你用谷歌搜索,你会发现很多这样的教程),但没有任何效果.

还设置了 PHPNature(感谢晶体管):

<性质><nature>org.eclipse.php.core.PHPNature</nature><nature>org.eclipse.wst.common.project.facet.core.nature</nature></自然>

(如果只有 PHPNature 集也不起作用,没有其他的)

[/编辑]

问题详解:我新建了一个Zend项目,尝试在IndexController.indexAction()中开始编码.我做的第一件事:我输入了 $this->,但是没有代码完成......我想也许我需要添加 Zend 库,我做到了.当我点击 class IndexController extends Zend_Controller_Action 中的 Zend_Controller_Action 时,我可以看到 Zend_Controller_Action 的文档,我也可以按 F3 和相应的文件将出现...这意味着,Zend 已成功添加为库.我也试过 Ctrl + Space,但没有任何反应.顺便说一句,像 isset() 这样的标准 PHP 函数也不会出现在代码完成中

有人知道如何解决这个问题吗?我正在使用带有 Eclipse PDT 3 和 Zend Framework 1.x 的 Eclipse Juno(不确切知道,但它不是 ZF2,如果我打开 http://localhost,它运行良好.>

感谢您的帮助

解决方案

我在将 eclipse 升级到 Kepler 时遇到了同样的问题.以下对我有用:

删除workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2下的文件

原因是workspace old DLTK index与新版本不兼容,需要重建.启动eclipse,DLTK索引会重新生成.

在那之后,代码完成再次对我有用.

I wanted to start a new Zend project, and currently I'm facing some issues regarding Eclipse PDT... My problem is, that the code completion in Eclipse for PHP does not work at all.

I tried a lot of different tutorials etc, for example making a new project and import the files; making a new workspace and import projects there; almost every possible combination of buildpath settings and library imports; deleting several files in .metadata (you will find lots of tutorials like this if you google for it), but nothing worked.

[Edit] Also the PHPNature is set (thanks to tranisstor):

<natures>
    <nature>org.eclipse.php.core.PHPNature</nature>
    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>

(It also does not work if there is only the PHPNature set, and no other in addition)

[/Edit]

The problem in detail: I made a new Zend project, and tried to start coding in the IndexController.indexAction(). First thing I did: I typed in $this->, but no code completion came... I thought maybe I would need to add the Zend library, which I did. When I click into the Zend_Controller_Action in class IndexController extends Zend_Controller_Action I can see the documentation of Zend_Controller_Action, I also can press F3 and the corrosponding file will appear... Which means, Zend is successfully added as library. I also tried Ctrl + Space, but just nothing happens. By the way, the standard PHP functions like isset() also won't show up in code completion

Does anybody have a idea how to fix this? I am using Eclipse Juno, with Eclipse PDT 3, and Zend Framework 1.x (don't know exactly, but it's not ZF2 and it works well if I open http://localhost.

I'm grateful for any help

解决方案

I had the same problem when upgrading eclipse to Kepler. The following worked for me:

Remove files under workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2

The reason was that the workspace old DLTK index is not compliant with the new version and needs to be rebuilt. Start eclipse and the DLTK index will be regenerated.

Code completion worked for me again after that.

这篇关于Eclipse PDT + 代码完成根本不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆