NetBeans auto-completion from included file not working? NetBeans auto-completion from included file not working? php php

NetBeans auto-completion from included file not working?


Make shure that all files of your project are in the project's include path (righ click project -> properties -> include path). Usually there is only the "global include path", which you configure in the NetBeans settings (e.g. to point to your PEAR directory). Add all directories which contain source code you want auto completion for to this include path. Hint: This include path has nothing to do with the include_path used in PHP itself.

Also instead of using hints in the cient code:

/* @var $TestObj test */$TestObj->...

You should give the sources some more apidoc, e.g.:

<?phpclass test {    /**     * @var SomeClass     */    public $var1;    /**     * @return int     */    public function someFunction() {        echo 'I am some function.';        return 0;    }}

because of the dynamic nature of PHP the IDE realies on this information to give right hints.


Go to Tools->Options-> click on PHP Icon on top -> General tab -> find "Global include path"-> Add Folder ->

if(onLinux) { choose /var/www; }if(onWindows) { choose c:\path_to_htdocs or whatever; }

Ah, too much programming for today.. :)

For me, this repaired autocompletion and ctrl+click on method call.


From netbeans go to tools->optionsGo to editor selection and from code Completion select php for languages section. This will expand menu and you will see a section Code Completion for Class Methods

Set that configuration by selecting checkboxes on that section.enter image description here

I hope I understood this right. I use netbeans too and I am able auto-complete after I change my netbeans settings.