Welcome Guest, Not a member yet? Register   Sign In
Aptana 3 and CodeIgniter 2 code completion
#1

[eluser]Unknown[/eluser]
Has anyone had any luck getting code completion to work with Aptana 3?
#2

[eluser]jesusOmar[/eluser]
I found is a bit different that with eclipse, I manage to get it working based on the instructions I found @ http://r15ch13.de/2011/03/autocomplete-i...igniter-2/
Quote:Window > Preferences > Aptana > Editors > PHP – Libraries
Click New user library, type in a name and select the path to the modified CodeIgniter library.
Quote:Deselect the library and close the Preferences.
Now open the properties of your actual project and go to PHP Buildpath > Libraries.
Uncheck “Use Project specified settings” and select the CodeIgniter library.
#3

[eluser]Unknown[/eluser]
So awesome. Thank you very much!
#4

[eluser]myselfzjp[/eluser]
Works here, thx
#5

[eluser]Unknown[/eluser]
Hey… after i searched a lot of time, i found the following site. Hope it helps you or each other..

http://thomas.deuling.org/2011/06/add-or...-studio-3/
#6

[eluser]jmp909[/eluser]
[quote author="jesusOmar" date="1304110364"]I found is a bit different that with eclipse, I manage to get it working based on the instructions I found @ http://r15ch13.de/2011/03/autocomplete-i...igniter-2/
[/quote]

I came up with a slightly "safer" solution. rather than modifying the system files, create a folder called "autocomplete" (or whatever name you want)

ie
Code:
application
autocomplete
system
user_guide

then create a file called in autocomplete/ called controller.php with the code below (class CI_Controller etc) . then copy this file and call it model.php and change the class in that file to CI_Model. Aptana then uses these to remap it's autocompletion. Just add any more functions you want autocompletion for for each file. (for instance i added CI_Cart which wasn't in the original example in that link

note you still have to follow the rest of the instructions in that link jesusOmar mentions above, but my way it means you only need to maintain your autocomplete folder without worrying about overwriting autocompletion in your system files. And anytime a new Class is added to the system core you should be able to add it to your autocomplete files

(Note currently this only gives autocomplete for Models and Controllers. I guess if you're extending other Classes and need autocompletion in those you'll need to make a new file in the autocomplete folder with a list of all the classes that you want that class to see)

Code:
class CI_Controller {
    
/**
  * @var CI_Config
  */
var $config;
/**
  * @var CI_DB_active_record
  */
var $db;
/**
  * @var CI_Email
  */
var $email;
/**
  * @var CI_Form_validation
  */
var $form_validation;
/**
  * @var CI_Input
  */
var $input;
/**
  * @var CI_Loader
  */
var $load;
/**
  * @var CI_Router
  */
var $router;
/**
  * @var CI_Session
  */
var $session;
/**
  * @var CI_Table
  */
var $table;
/**
  * @var CI_Unit_test
  */
var $unit;
/**
  * @var CI_URI
  */
var $uri;
/**
  * @var CI_Pagination
  */
var $pagination;

/**
* @var CI_Cart
*/
var $cart;
    
}

?>
#7

[eluser]jmp909[/eluser]
another solution that seems to work .. and i find simpler to maintain

in that autocomplete folder just create one file like the one below

try this
Code:
<?php

class _
{    
    function _()
    {

        // any classes you want included in autocompletion                
        $this->load = new CI_Loader();
        $this->config = new CI_Config();        
        $this->email = new CI_Email();
        $this->encrypt = new CI_Encrypt();
        $this->pagination = new CI_Pagination;
        $this->session = new CI_Session();
        $this->driver = new CI_Driver();
        $this->benchmark = new CI_Benchmark();
        $this->typography = new CI_Typography();
        $this->form_validation = new CI_Form_validation();
        $this->profiler = new CI_Profiler();
        $this->image_lib = new CI_Image_lib();
        $this->math = new Math();
        $this->calendar = new CI_Calendar();
        $this->db = new CI_DB_active_record();
        $this->table = new CI_Table();
        $this->table = new MY_Table();
        $this->ftp = new CI_FTP();
        $this->output = new CI_Output();
        $this->javascript = new CI_Javascript();
            
        // note you'll need to use $this->CI = & getInstance() in extended libs
        // in order for the CI to autocomplete
        $this->CI=new CI_Controller();
        
    }
    
}

// any classes you want autocomplete for
class CI_Controller extends _ {}
class CI_Model extends _ {}
class CI_Form_validation extends _ {}
class CI_Table extends _ {}
?>

now from your application/controller classes, the autocomplete will pick up as required... so you can now do
Code:
$this->load->libray("profiler");
$this->profiler->.... [functions now appear in autocomplete dropdown]

just make sure you stick to the correct naming conventions.

remember this file in autocomplete folder never gets run, it's just there to map the autocompletion in aptana
#8

[eluser]handoyo[/eluser]
Hi all,does it work with $this->load->view()? Thanks..
#9

[eluser]tim.samuelsson[/eluser]
[quote author="jmp909" date="1311212108"]another solution that seems to work .. and i find simpler to maintain

in that autocomplete folder just create one file like the one below

try this
Code:
<?php

class _
{    
    function _()
    {

        // any classes you want included in autocompletion                
        $this->load = new CI_Loader();
        $this->config = new CI_Config();        
        $this->email = new CI_Email();
        $this->encrypt = new CI_Encrypt();
        $this->pagination = new CI_Pagination;
        $this->session = new CI_Session();
        $this->driver = new CI_Driver();
        $this->benchmark = new CI_Benchmark();
        $this->typography = new CI_Typography();
        $this->form_validation = new CI_Form_validation();
        $this->profiler = new CI_Profiler();
        $this->image_lib = new CI_Image_lib();
        $this->math = new Math();
        $this->calendar = new CI_Calendar();
        $this->db = new CI_DB_active_record();
        $this->table = new CI_Table();
        $this->table = new MY_Table();
        $this->ftp = new CI_FTP();
        $this->output = new CI_Output();
        $this->javascript = new CI_Javascript();
            
        // note you'll need to use $this->CI = & getInstance() in extended libs
        // in order for the CI to autocomplete
        $this->CI=new CI_Controller();
        
    }
    
}

// any classes you want autocomplete for
class CI_Controller extends _ {}
class CI_Model extends _ {}
class CI_Form_validation extends _ {}
class CI_Table extends _ {}
?>

now from your application/controller classes, the autocomplete will pick up as required... so you can now do
Code:
$this->load->libray("profiler");
$this->profiler->.... [functions now appear in autocomplete dropdown]

just make sure you stick to the correct naming conventions.

remember this file in autocomplete folder never gets run, it's just there to map the autocompletion in aptana[/quote]

Hello,

I'm trying to extend the autocomplete with a thirdpart-library. (http://www.jenssegers.be/projects/view/C...te-Library) But I wont succed with adding it... Do you have any ideas?
#10

[eluser]Daniel Moore[/eluser]
Makes me glad I don't use Aptana/Eclipse. Not only because they are SOOO SLOW! I personally like my IDE to be really fast.

My IDE handles code completion for CodeIgniter simply by creating a project, and pointing the project to the CodeIgniter installation directory. It scans and creates code completion on the fly, so that every time I use a CodeIgniter project, it always handles auto-complete for me the proper way, and I never have to worry about getting a new auto-complete plug-in whenever the CodeIgniter version changes.

But hey, that's what you get when you try to cut corners and use a free IDE. (Although I wouldn't use a pay IDE like Zend, because it is also built on Eclipse, and is extremely slow and buggy at times as well.)

Mine will also allow me to have auto-complete for any project, such as when I'm editing the code for a Simple Machines Forum, or editing a Word Press installation (rare for me), or when I plug in ANY 3rd party library to CodeIgniter, it automatically picks up everything needed for auto-complete for that library.

And yes, it works with $this->load->view and more.

UEStudio, the most powerful, feature complete, fastest IDE on the market. If you say your IDE does something mine doesn't, give me 10 minutes and I'll have mine doing it. Full snippet support, built-in, will be in the next version coming out in the next month or so, which is the only thing it hasn't had out of the box that I have been wanting. This program has paid for itself many, many times over in the time and frustration it has saved me. The faster I can program a project, the more money I can make. And this IDE delivers like no other, but only if you take time to learn it properly. I mean, take swimming lessons, don't just walk to the rail of the bridge and jump over into the water and hope you can swim. Wink Making more money involves investing time and money, but it is so worth it when you do.




Theme © iAndrew 2016 - Forum software by © MyBB