NetBeans PHP code completion for own code

南楼画角 提交于 2019-11-27 04:03:53
dr Hannibal Lecter

I've tried opening your project, and the completion seems to be working just fine for me.

The only thing I can think of is to try to delete your entire NB cache, which should be located in $HOME/.netbeans/$VERSION/var/cache/. This is a wild guess

Create a backup first, I didn't try this!

If that fails, maybe you should try creating a new project, maybe that will kick NB in the butt.

Note that in NB 7.2 beta, the cache has moved to $HOME/.cache/netbeans/$VERSION.

What worked for me was deleting the old nbproject folder (that was created in windows) and recreating the PHP project from existing sources. This is on NB 7.0.1 Mac OS X. Clearing the cache did not work for me.

Michał Pilch

Be aware of @property something syntax. If object something does not exists in your code anymore, NetBeans might have problems with proper code completion. Consider example:

/** in main file: **/

use ABC as _ ;

/** in file ABC: **/

/** 
  *  @property \Something $something
  */

If you do not use $something anymore, NetBeans will most likely generate an exception, thus failing to complete the code.

Jonathan Hendler

What worked for me was clearing the cache, then explicitly including some key subdirectories in the Global include path. Appears that for some reason NB 6.7 wasn't recursing the directories.

Including at project level also worked Project->Properties->Include Path Netbeans 7.01 + Windows 7

If, for instance, you open a php file with netbeans without being part of a project, code completion doesn't work at all. What you need to do is to create a project having that file in it.

Tested this on NetBeans 7.0.1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!