Aptana autocomplete shows only local stuff - php

I am trying out Aptana for general PHP development, i loaded an old CakePhp project to test the autocomplete and all i can get are the local functions and variable and absolutely none of the inherited ones, which kinda ruins the whole thing. Is there a setting i dont know about that fixes this?

apparently i needed to set up a "Nature" to PHP, the default was some eclipse.something version. Aptana reindexed the file and it works now.

The original poster was correct in adding PHP to the "Nature" of the project, however he did not provide how to do it. I also had the same problem and once I added PHP to the "Nature" selection list the autocomplete provided the options for inherited classess as well.
To add the PHP Nature:
Right click on your project in the Project Explorer View
Click on Properties
In the "Properties for project" window, select Project Natures in the left list box
In the Project Natures window, place a tick next to PHP
Click on OK button
that should get you the autocomplete list.
AJ

I haven't used aptana for PHP, but since it's based on Eclipse I assume the cake folder (in the same level as your app folder usually) needs to be added to your project path.
You can go into the properties of your project and either add it to the path or add it to the libraries.
I usually setup my project to point to the whole folder so I don't need need to do this step, but my Eclipse installation will pick up the inherited methods just fine.

Related

How to exclude library from autocomplete in Netbeans?

As I try to use the auto-complete pop-up window in Netbeans on my PHP project, a huge swath of CakePHP methods tend to fill the window, and it makes finding what I need more difficult. (I'm not even using CakePHP in the project...)
Is there a way to prevent CakePHP which I am not using, or generically any other library, from showing up in that window?
Thanks.
Update:
Disabling cakephp did remove it from the autocomplete window, but it looks like my primary issue is with the fact that netbeans didn't seem to know what object I am referring to in these cases (because it is a global/defined elsewhere)
When it knows the exact class it provides a proper list of methods to choose from. There seems to be a "red dot" graphic beside methods related to the object, and this "thought bubble" type graphic beside ones that are just grabbed from all libraries netbeans knows about
The only way I have in my mind for this moment is to disable the CakePHP plugin. I have installed it separately so the path in my IDE is Tools -> Plugins -> User Installed Plugins (which is PHP CakePHP Framework).

Aptana Studio 3 code completion / assist not working for Yii Framework

I just started development with Aptana Studio 3 and Yiiframework. Since Aptana Studio 3 already supports code completion for PHP and Yiiframework does faciliate correct use of PHPDoc comments and return types, I assumed that calling
$app = Yii::app();
$app->...
should pop up content assist with methods and fields of the CApplication class. But I only see an empty popup window containing 'No proposal'. The same happens when accessing the application object directly using
Yii::app()-> // empty code assist window
When I declare the type of the $app variable explicitly, code assist pops up correct:
/**
* #var CApplication
*/
$app = Yii::app();
$app-> // code assist pops up with correct content
I don't have included yiilite.php - this file is stripped from my framework directory. Code assist works, but not as expected.
Is this a bug, or a missing feature? Can anybody else confirm this behaviour of Aptana Studio 3? Is there any workaround?
Thanks,
David
It is also important to explicitly set the 'Project Nature' to (include) PHP. Project->properties->Project Natures
Follow the steps given here and the code completion should work properly.
The other methods mentioned here will not work for YII code assist.
See if this helps:
Start with a PHP Project (Or for an existing project: Configure -> Add PHP support )
Add the YII framework to the build path like below.
PHP Include path -> Libraries -> Add External source folder -> Select the 'framework' folder from the YII framework unzipped
Also point #5 from Arek about adding the Eclipse PHP nature helped me too. Thanks
I don't know how exactly I did this, but:
Delete already existing project.
Install PDT plugin for
Aptana by "Help->Install New Software"
Restart Aptana Studio
Create again new project and check out in project properties You have new "Nature" called
"org.eclipse.php.core.PHPNature" as a primary.
Uncheck "PHP"
Nature, only "org.eclipse..." should be checked.
Only with this nature I see all classes, methods etc...
With orginial aptana's "PHP" Nature it was impossible.
"org.eclipse.php.core.PHPNature" is solution for this.
EDIT: PDT might not be required for Aptana since it has PHP support built-in
http://firas-vision.com/aptana-yii-2/
please check this solution worked for me , no new plugin , it is just a code fix for com.aptana.editor.php.jar plugin
I pulled a request to change on Aptana git , hope they will include this fix in the next release
http://www.yiiframework.com/forum/index.php/topic/45905-aptana-yii-support-autocomplete/ this seems to have helped with the solution.
unzip your yii source tarbal, import the framework directory as a project on your workspace
Navigate to Your project Explorer, and right click on the project you wish to support Yii's autocomplete on and select "Properties"
A project properties' dialog page will be displayed, on the right side of the dialog there is a tree select the child labelled "PHP Buildpath", on your right click on "Add" and add the "Framework Directory " as part of your build path
Apply Changes and Press OK to submit the changes. Now try to create a class that extends any of the Yii Core Classes it should autocomplete successfully.
Enjoy Yourself

How Do I Enable Bookmarks in Eclipse?

I am using Eclipse (Version: Helios Service Release 2 Build id: 20110301-1815) for a PHP project and would like to use the Bookmark feature. However, right-clicking in the margin shows the Add Bookmark item dimmed out. The Edit menu also shows it dimmed out. For that matter, Add Task is also dimmed out in both locations.
How do I turn on this feature?
Make sure you're in a project and that the file you want to place a bookmark in belongs to that project. Otherwise it won't work.

Eclipse and PHP: directories in project's root

I'm using Eclipse Galileo for PHP Developers and when I create new, empty project I have 3 folders inside:
JavaScript Resources
PHP Include Path
PHP Language Library
Does Eclipse make copy of PHP for every project? And more important: can I hide it from my project navigator tree?
If you click on the arrow in the Top Right corner of the PHP Explorer and select "Filters" you CAN exclude them from the view. Select "Libraries from external" and "Libraries in project". Unfortunately I haven't been able to figure out how to hide the JavaScript Resources folder.
You are wrong, they are not folders, they are just references, which are defined within the project properties and pdt manages for you. Just look into the folder with your prefered file manager and you will not find folders with this names. So no, eclipse doesnt copy php.
And no, you cant hide them from the php navigator view. There is no obvious reason to hide them anyway.

Some beginners eclipse questions

I have recently ditch Dreamweaver as my IDE for my web projects and I'm currently using Eclipse. My current web project is written in PHP, but I'm not so familiar with Eclipse yet. I downloaded the Eclipse PDT. which has all the PHP developer plugins. And my first questions when I start a project does it mean I'm creating a root folder? and shall I choose PHP project or static web project? I've choosed the PHP project,but I just need to know that I'm not choosing the wrong one.
And why is it showing an error(an exclamation mark) when I try to add some javascripts to my index.php file?
<script type="text/javascript" src="javascripts/addTools.js"></script>
when I hoover over the exclamation mark I get the following info:
Multipel annotation found at this line:
-starttag of element script
-undefined attribute name (src)
-undefined attribute name (type)
-endtag of element script
As far as I know I have used the correct syntax for adding external javascripts to a html. Seems like a bug?
I can still run the website but it is just an annoying moment, pls help me anyone?
REQUESTED SCREEN DUMP:
static web project is for a web project with only html pages. No dynamic pages with php for instance. You choose the good one.
The syntax seems correct, could you show us the full code, or even a screenshot of your editor? It seems the editor is not aware about the html dtd.

Categories