Eclipse PDT 自动完成

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2722399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:40:28  来源:igfitidea点击:

Eclipse PDT Autocomplete

phpeclipseautocompleteeclipse-pdt

提问by Abenil

this sounds a bit stupid, but i try for several days now to get autocomplete working. i have a clean install of pdt and one with plugins like aptana and subversion, but none works with autocomplete. what do i have to do that i get a list with all functions, variables, etc beginning with "str" for example when i type "str"? Do i need some shortcut for this? In Netbeans it is working without shortcuts...and this video looks like its working in eclipse too. link text

这听起来有点愚蠢,但我尝试了几天来让自动完成工作。我有一个全新安装的 pdt 和一个带有 aptana 和 subversion 等插件的安装,但没有一个可以使用自动完成。我该怎么做才能得到一个包含以“str”开头的所有函数、变量等的列表,例如当我输入“str”时?我需要一些捷径吗?在 Netbeans 中,它可以在没有捷径的情况下工作……而且这个视频看起来也可以在 eclipse 中工作。 链接文字

Thanks for any hints and help ;) Regards

感谢您的任何提示和帮助;) 问候

回答by hendepher

For me, when using PDT, when I begin to type a variable, I can do Ctrl-space and I get a list of matching defined variables in my code. I believe you can get the list automatically. If you go Window ? Preferences, then find PHP in the left column. Expand PHP, expand Editor, and select Code Assist. I believe Auto Activation is the option to pop up the autocomplete automatically.

对我来说,当使用 PDT 时,当我开始键入一个变量时,我可以按 Ctrl-space 并在我的代码中获得匹配的已定义变量的列表。我相信您可以自动获取列表。如果你去Window ? Preferences,然后在左栏中找到 PHP。展开 PHP,展开编辑器,然后选择 Code Assist。我相信自动激活是自动弹出自动完成的选项。

回答by Mike Starov

I tried to follow the accepted answer with no use. Then I found answer to this question in another SO thread. Basically all you need to do is right click on the project and go to Configure > Add PHP support. If that option is grayed out then you already marked project as the PDT project.

我试图按照接受的答案没有用。然后我在另一个 SO 线程中找到了这个问题的答案。基本上,您需要做的就是右键单击项目并转到配置 > 添加 PHP 支持。如果该选项变灰,则您已经将项目标记为 PDT 项目。

回答by fbtb

hint: check General > Editors > File Associations > .php (.phtml,...) if default editor is "PHP Editor"

提示:如果默认编辑器是“PHP 编辑器”,请检查 General > Editors > File Associations > .php (.phtml,...)

回答by Dan

This worked for me

这对我有用

Right click on you project in the project Explorer ? Configure ? Add PHP support...

在项目资源管理器中右键单击您的项目?配置 ?添加 PHP 支持...

enter image description here

在此处输入图片说明

回答by Abenil

ok, i found the solution now. if anyone else has same problems here is the way: go to window->preferences->PHP->Editor->Code Assist

好的,我现在找到了解决方案。如果其他人有同样的问题,方法如下:转到 window->preferences->PHP->Editor->Code Assist