简体   繁体   English

WordPress的Aptana Studio Code Assist不完整

[英]Aptana Studio Code Assist for WordPress is incomplete

I installed the WordPress bundle/ruble for Aptana Studio , but it's only providing code assistance for a subset of WordPress functions. 为Aptana Studio安装了WordPress软件包/卢布 ,但它只为WordPress功能的子集提供代码帮助。 I'd like code assistance for all WordPress core functions (or as many as possible). 我想为所有WordPress核心功能(或尽可能多的)提供代码帮助。 My projects have PHP as their nature, and are connected via SFTP to remote WordPress installations. 我的项目以PHP为特色,并通过SFTP连接到远程WordPress安装。

After the bundle (which hasn't been updated in over a year) didn't provide everything I was looking for, I tried using a local copy of WordPress as an external library, then adding it as an external directory to the PHP Buildpath. 在捆绑包(一年内未更新)之后没有提供我想要的所有东西,我尝试使用WordPress的本地副本作为外部库,然后将其作为外部目录添加到PHP Buildpath。 Neither one added any more functions than the bundle provided. 没有人添加任何功能而不是提供的包。 These actions were suggested in Aptana Studio Support and WordPress Answers . 这些操作在Aptana Studio支持WordPress Answers中提出

Am I doing something wrong, or is the level of code assistance I'm looking for not available? 我做错了什么,或者我正在寻找的代码协助级别不可用?

It's true that the WordPress bundle offers just some limited auto-completion support. 确实,WordPress捆绑包提供了一些有限的自动完成支持。 Though including the local copy of another WordPress installation as a PHP external library seemed to solve this in the latest Aptana Studio version (3.4.0,) as you already mention to have tried, and as it is suggested in this one of the links that you pointed out. 虽然包含另一个WordPress安装的本地副本作为PHP外部库似乎在最新的Aptana Studio版本(3.4.0)中解决了这个问题,正如您已经提到过的那样,并且正如在此链接中建议的那样你指出了。

Here are all the specific steps I took, so you can check if there was something different in the procedure you followed. 以下是我采取的所有具体步骤,因此您可以检查您遵循的程序是否有不同之处。

  • Open the Preferences menu going to Window > Preferences 打开首选项菜单,转到窗口>首选项
  • Select Aptana Studio > Editors > PHP > Libraries 选择Aptana Studio>编辑器> PHP>库
  • Click "New user library" 点击“新用户库”
  • Add the path to another local WordPress installation (not the same WordPress files in the current project,) selecting the root folder of a freshly extracted WordPress download (eg: C:\\wordpress-3.5.1\\wordpress) 将路径添加到另一个本地WordPress安装(当前项目中不是相同的WordPress文件),选择新提取的WordPress下载的根文件夹(例如:C:\\ wordpress-3.5.1 \\ wordpress)
  • Make sure the new library is selected in the user libraries list (marking it with a checkmark next to the library icon.) 确保在用户库列表中选择了新库(使用库图标旁边的复选标记对其进行标记。)
  • Apply the changes and press OK 应用更改并按“确定”
  • Make sure your project is a PHP project. 确保您的项目是一个PHP项目。 Right click the project folder, select Properties > Project Natures and mark the PHP checkbox. 右键单击项目文件夹,选择Properties> Project Natures并标记PHP复选框。

Now, inside PHP code, I get autocompletion suggestions for all core WordPress functions - and I can even go to check their source by pressing F3 on their function name. 现在,在PHP代码中,我获得了所有核心WordPress函数的自动完成建议 - 我甚至可以通过在其函数名称上按F3来检查其源代码。

I followed the steps of E. Serrano and it works perfectly. 我按照E. Serrano的步骤操作,效果很好。 What is silly is that if you want autocompletion for, say, add_action('wp_print_footer_scripts', 'scripts.js', 1); 愚蠢的是,如果你想要自动完成,比如add_action('wp_print_footer_scripts', 'scripts.js', 1); the moment that you type the quote, autocompletion is lost... if you try add_action( wp_ you get all WP commands. Hope it helps... 在你输入引号的那一刻,自动完成就会丢失......如果你尝试add_action( wp_你得到所有WP命令。希望它有帮助...

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

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