dongyong6045
2013-10-30 18:51
浏览 60

如何使netbeans IDE了解其他项目中的类和方法以完成代码

I am working on a website in php which is comprised of 2 SVN repositories. One repo has classes in it while the other has scripts in it, so scripts in the script repository will make use of classes in the other repository. I am using Netbeans 7.3.1 to maintain the website, and as such each repository is its own Netbeans project.

This all works out just fine on the server, but a problem is that when working in netbeans, I can only get class name suggestions, method name suggestions, phpdoc, etc., for classes and methods in the same project, so like:

Class repo: class myStaticClass has some static methods in it, when I am editing another class class someOtherClass in the same project, I can type in myStaticClass:: and netbeans will have a list populated with the static methods of that class.

However, when I am in the script repo, I will type myStaticClass:: and netbeans has nothing to say about it.

When I reference a class in the scripts repository, netbeans does not suggest method names or display phpdoc for methods. Is there anyway to make netbeans "look" at all projects when it is trying to gather the live data it presents as you type, rather than just the project you are currently modifying?

Restructuring, moving, or in anyway modifying the repos themselves is NOT an option!

Thanks

图片转代码服务由CSDN问答提供 功能建议

我正在开发一个由2个SVN存储库组成的php网站。 一个repo中包含类,而另一个repo中包含脚本,因此脚本存储库中的脚本将使用另一个存储库中的类。 我正在使用Netbeans 7.3.1来维护网站,因此每个存储库都是自己的Netbeans项目。

这一切都在服务器上正常运行,但问题在于 在netbeans中工作,我只能获得同一项目中的类和方法的类名建议,方法名称建议,phpdoc等,如:

类repo: class myStaticClass 中有一些静态方法,当我在同一个项目中编辑另一个类 class someOtherClass 时,我可以输入 myStaticClass :: 和netbeans将 有一个用该类的静态方法填充的列表。

但是,当我在脚本仓库中时,我将输入 myStaticClass :: ,netbeans什么都没有 关于它。

当我在脚本库中引用一个类时,netbeans不建议方法名称或显示方法的phpdoc。 无论如何,当netbeans试图收集它在你输入时呈现的实时数据而不仅仅是你当前正在修改的项目时,它会“看”所有项目吗?

重组,移动或以任何方式修改repos本身不是一种选择!

谢谢

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanmo5724 2013-11-01 01:08
    已采纳

    I think you'd have to add your project with classes in the PHP Include Path of the project with scripts.

    Look for this in the Project Properties and add the corresponding folder as shown in the documentation pages of the NB site.

    打赏 评论

相关推荐 更多相似问题