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.
Hi, In 6.7 the following code could code complete at the marked place. I would expect 'y()' to be completed. In 6.8M2 it is no longer possible. Only observation I can make is that in 6.7 the 'a' in $this->a = new x(); is highlighted green, whereas in 6.8M2 it is black. Not sure if that's a clue or not. <?php class x { function y() { } } class foo { public function bar() { $this->a = new x(); $this->a->**code complete here** } }
Just to note, adding: /** * @var x */ public $a; to class foo allows code completion to work.
Magic property $a should be documented this way: /** * @property x $a */ class foo { then CC in NB works properly. For non magic property is this declaration(without $var) enough: public $a; to work CC in NB => P3
Hi, thanks for the response. In 6.7 the autocomplete would work ok without any phpdoc comments - are you saying this is a change for 6.8 where all properties must now be documented with phpdoc for code completion to work?
I'm going to look at it and fix it but I think P3 is more appropriate here. Anyway thanks for the report
ok thanks - the reason it's important to me is the new symfony framework support. In a symfony action it is typical to just to set $this->varname without a phpdoc definition as they are just passed to the template.
adding CC tomas who is responsible for symfony, thanks for this comment Tomas, please be informed that this issue is related to symfony support (you can review the priority)
> ok thanks - the reason it's important to me is the new symfony framework support. In a symfony action it is > typical to just to set $this->varname without a phpdoc definition as they are just passed to the template. Sorry, this is out of scope for Symfony framework for NB 6.8. It is planned for the next release. Currently, only $sf_user, $sf_request and $sf_response variables are available in a Symfony template.
Hi, thanks for response. I understand that the variable won't be code completed in the template (though that would be fantastic if it could!), however it is quite common for me to do: $this->variable = new Whatever(); foreach ($this->variable->getSomething() as $x) { // etc } in an action. Obviously this doesn't just affect symfony, but i would say it's common in an action to not phpdoc all the properties (then used as a variable in the template), which may differ from 'best practice'. Still, the priority is up to you guys, though it did use to work in 6.7.
Fixed: http://hg.netbeans.org/web-main/rev/5900b68694c3 http://hg.netbeans.org/web-main/rev/c89fc2658062 http://hg.netbeans.org/web-main/rev/83671e2c3b1b
Product Version: NetBeans IDE Dev (Build 100503-2daaf2ae8a4f) Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01 verified