【发布时间】:2016-03-01 22:58:38
【问题描述】:
奇怪的自动完成行为:
class myFirstClass
{
public function myFunc1() {}
public function myFunc2() {}
}
class mySecondClass
{
/**
* @return myFirstClass
*/
public function getMyFirstClass()
{
return new myFirstClass();
}
public function init()
{
$myFirstClass = new myFirstClass();
$myFirstClass-> // autoComplete works here and shows myFunc1 and myFunc2
$this->myFirstClass = new myFirstClass();
$this->myFirstClass-> // autoComplete does not work here
$this->getMyFirstClass()-> // autoComplete works here and shows myFunc1 and myFunc2
$this->myFirstClass2 = $this->getMyFirstClass();
$this->myFirstClass2-> // autoComplete does not work here
$this->myFirstClass2->myFunc1(); // cmd+click on myFunc1() in this line jumps to the myFunc1-function in myFirstClass, so netbeans "knows" the right class, but doesn't autocomplete :(
}
}
如果没有 $this,代码自动完成功能会按预期工作,但如果使用 $this->,它将不再显示任何内容。这是一个已知的 NetBeans 错误还是有解决此问题的设置?
【问题讨论】:
标签: php netbeans autocomplete