ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Aptana 3 and CodeIgniter 2 code completion

April 28, 2011 1:20pm

Subscribe [9]
  • #1 / Apr 28, 2011 1:20pm

    kutothe

    1 posts

    Has anyone had any luck getting code completion to work with Aptana 3?

  • #2 / Apr 29, 2011 12:52pm

    jesusOmar

    2 posts

    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-in-aptana-3-for-codeigniter-2/

    Window > Preferences > Aptana > Editors > PHP – Libraries
    Click New user library, type in a name and select the path to the modified CodeIgniter library.

    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 / May 02, 2011 1:57pm

    kutothe

    1 posts

    So awesome. Thank you very much!

  • #4 / May 02, 2011 5:02pm

    myselfzjp

    2 posts

    Works here, thx

  • #5 / Jun 02, 2011 9:45am

    LaSlow

    1 posts

    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-edit-code-snippets-and-templates-in-aptana-studio-3/

  • #6 / Jul 20, 2011 8:57pm

    jmp909

    5 posts

    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-in-aptana-3-for-codeigniter-2/

    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

    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)

    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 / Jul 20, 2011 9:35pm

    jmp909

    5 posts

    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

    <?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

    $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 / Dec 28, 2011 12:42am

    Elegant Rao

    8 posts

    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

    application
    autocomplete
    system
    user_guide

    t….
    </code></pre>

     

    that all worked out exaktly the way it should. thank you . 😊

  • #9 / Jan 20, 2012 5:59am

    handoyo

    25 posts

    Hi all,does it work with $this->load->view()? Thanks..

  • #10 / Mar 14, 2012 6:58am

    tim.samuelsson

    2 posts

    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

    <?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

    $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

    Hello,

    I’m trying to extend the autocomplete with a thirdpart-library. (http://www.jenssegers.be/projects/view/CodeIgniter-Template-Library)  But I wont succed with adding it… Do you have any ideas?

  • #11 / Mar 14, 2012 10:06am

    anonymous65551

    222 posts

    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.  😉  Making more money involves investing time and money, but it is so worth it when you do.

  • #12 / Mar 14, 2012 1:10pm

    CroNiX

    4713 posts

    @Daniel Moore - Stepping debugger with conditionals, git integration, github integration, able to switch php versions on the fly for testing?

  • #13 / Mar 14, 2012 1:47pm

    anonymous65551

    222 posts

    @CroNiX, everything except git.  It uses SVN and CVS, and has plans to implement git in the future.  Switching PHP versions on the fly?  Wouldn’t use an IDE without it.  Stepping debugger?  Please, I hate echo statements for debugging.  Of course it does.

    I don’t use git, I use SVN. Period.  So not a big deal for me. 

    I can, however, integrate command line tools and make it function seamlessly with git by adding hot-keys and/or menu commands to handle that.  It’s quite easy to do with UEStudio. I have done it for a great many other things and it works great.  For a seasoned UEStudio user, the only thing I would have to learn is the git syntax, which shouldn’t take long since I’m seasoned in SVN already.  It’s only a bit different in how it is implemented.

  • #14 / Mar 14, 2012 1:57pm

    CroNiX

    4713 posts

    Does the stepping debugger let you use conditional breakpoints?  Like “$a = ‘mickey’” so it will only halt if the condition is met?  I haven’t used SVN for years and most projects use GIT nowadays, so git would be crucial for me and projects I pick up.  Thanks for the clarifications, the website doesn’t spell everything out.

  • #15 / Mar 14, 2012 3:02pm

    anonymous65551

    222 posts

    I’ve never used conditional breakpoints in my life, and I’ve been programming since the mid-1970s.  I actually can’t think of an example where I’d use it, but I suppose it must come up somewhere.

    So, I just checked to see if UEStudio does it.  It does not.  I have just tested a few other commercial IDE products that have integrated debugging, though these IDE products do not handle PHP, they are for specific compiled languages only, which are more likely to do more with debugging.  None of them actually support conditional breakpoints.  Could be why I’ve never used them. 

    I’ll talk with the support department about the possible use of GIT in the upcoming version before I go to any trouble to try to integrate it.  I’ll let you know what the answer is.  I’ll also question them about the possible upgrade to conditional breakpoints and see what they have to say about it.  That’s another beauty of having a product that is paid for from a good and decent company.  They offer lifetime support, and they have never once been rude about support in any way, bending over backwards to help wherever they can.  Many of the features I have requested over the last 5 years have been implemented, including the way it parses a project in order to set up all the auto-complete lists for you. 

    Including the upcoming “Smart Templates” which act as an unlimited storage of snippets, and now I’m really getting off topic.  Didn’t mean to steal it.  I’ll let you know what support has to say, hopefully it will be implemented.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases