This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When assigning a variable to the return of a function, the netbeans IDE provides autocompletion. There is one exception though. In some class: class SomeClass { function foo() { $s = $t = $u = $v = $w = $x = $y = $z = $this->$bar(); } function foo2() { $f = $this->$bar(); $t = $this->$bar(); $T = $this->$bar(); } /** * @return SomeClassReturn */ function bar() { } } the `$t` (lowercase) variables in the ::foo() and ::foo2() methods will not provide autocompletion even though the other variables do. If I assign the $t variable directly to the desired object, it will provide autocompletion. This bug also applies to Netbeans 7.0M1
I'm sorry, but I think that I don't understand what you mean. Where is a return statement which doesn't work? Can you discribe that step by step until the problem occurs? With a highlighted caret position where should autocompletion appear? And can you try to reproduce it in NB 7.0 RC1? Thanks.
Created attachment 107471 [details] Case of failure in phpdoc autocomplete IDE does not supply autocomplete for variable $t
Created attachment 107472 [details] Intended behaviour for autocomplete IDE offers autocompletion on $a (and other) variables
I've attached two images, which I hope will make the issue more clear. The screenshots are from 7.0M2, but the issue also appears in the RC1. $a->[ctrl+space] offers autocompletion according to phpdoc comments $t->[ctrl+space] does not offer autocompletion according to phpdoc comments Sample code: (opening and closing tags omitted) class Bar { /** * PHPdoc for getBar() */ function bar() { } /** * Returns Foo object * @return Foo */ function getFoo() { } } class Foo { function foo() { $a = $this->getBar(); $b = $this->getBar(); $t = $this->getBar(); $t2 = $this->getBar(); $a->// gives autocompletion $t->// does not give autocompletion } /** * @return Bar */ function getBar() { } }
Batch reassigning.
Editor area.
Fixed in web-main: http://hg.netbeans.org/web-main/rev/eb8e5a7b4652
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/eb8e5a7b4652 User: Ondrej Brejla <obrejla@netbeans.org> Log: #191666 - `t` variable does not provide autocompletion when method call is from $this object