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

7

1

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

Exceed answered 2/3, 2012 at 10:50 Comment(3)
Yii framework is inside the same Aptana project. I also have cleaned project cache multiple times with 'Project'->'Clean' without success.Exceed
Found some Youtube video addressing exactly the same problem. Seems to be an missing Aptana Studio 3 feature? youtube.com/watch?v=5fPgDCXdqzYExceed
Aptana Studio 2 supports these PHPDoc comments and also code completion. It seems this is some kind of Aptana 3 bug (or a missing feature?)Exceed
M
4

It is also important to explicitly set the 'Project Nature' to (include) PHP. Project->properties->Project Natures

Malliemallin answered 11/6, 2012 at 8:23 Comment(0)
D
2

Follow the steps given here and the code completion should work properly.

Declassify answered 9/6, 2012 at 15:54 Comment(0)
J
1

The other methods mentioned here will not work for YII code assist.

See if this helps:

  1. Start with a PHP Project (Or for an existing project: Configure -> Add PHP support )
  2. 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

Jerboa answered 12/1, 2013 at 18:26 Comment(0)
M
0

I don't know how exactly I did this, but:

  1. Delete already existing project.
  2. Install PDT plugin for Aptana by "Help->Install New Software"
  3. Restart Aptana Studio
  4. Create again new project and check out in project properties You have new "Nature" called "org.eclipse.php.core.PHPNature" as a primary.
  5. 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

Medullary answered 14/12, 2012 at 1:30 Comment(0)
T
0

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

Triolet answered 5/8, 2013 at 20:48 Comment(0)
O
0

http://www.yiiframework.com/forum/index.php/topic/45905-aptana-yii-support-autocomplete/ this seems to have helped with the solution.

Omland answered 20/8, 2014 at 9:12 Comment(0)
O
0
  1. unzip your yii source tarbal, import the framework directory as a project on your workspace
  2. Navigate to Your project Explorer, and right click on the project you wish to support Yii's autocomplete on and select "Properties"
  3. 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
  4. 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

Omland answered 20/8, 2014 at 9:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.