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.
Summary: | [Type] code completion + vdoc + array acces | ||
---|---|---|---|
Product: | php | Reporter: | honzamarek <honzamarek> |
Component: | Editor | Assignee: | Ondrej Brejla <obrejla> |
Status: | NEW --- | ||
Severity: | blocker | CC: | tmysik |
Priority: | P3 | ||
Version: | 7.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
example
example screenshot |
Description
honzamarek
2009-10-20 12:39:39 UTC
Reassigning to the proper component, but anyway, closing as INVALID. The correct form for vdoc template is just one "*" in the beginning (it's not PhpDoc, it's NetBeans' own extension) so the correct code for your example is: /* @var $var DirectoryIterator */ BTW do you know that you can type "vdoc" followed by TAB above $var = ... line and the template is generated for you? BTW in the generated comment, code completion works for the type/class as expected. I just verified that it works in the current dev build. Thanks for reporting. Are you sure? In Netbeans Dev 200910170201 it still doesn't work. I know that template. I wrote two stars because I assumed that there are two stars (I didn't copied it by ctrl c, ctrl v). > Are you sure? In Netbeans Dev 200910170201 it still doesn't work.
Yes, still works for me. Feel free to attach a page where it does not.
I will attach my working example.
Product Version: NetBeans IDE Dev (Build 091021)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
System: Linux version 2.6.28-15-generic running on amd64; UTF-8; cs_CZ (nb)
Created attachment 89869 [details]
example
Created attachment 89874 [details]
example
Created attachment 89875 [details]
screenshot
It was more difficult to create non-working example than I originally thought. In most cases this problem doesn't exist. OK, I see now. Please attach a sample project, we really need it to solve it because this feature mostly works. Thanks. Reassigning to Radek, please have a look at it (the last screenshot). Marking as INCOMPLETE till the sample project is attached. Thanks. Sorry, I overlooked the example file. That should be enough. Yes, this is obviously bug: dog can't be cat and vice versa. This issue has deeper roots(meaning that type inference for arrays and array access is rather poor - we are aware of it but on the other hand its uneasy task that will take much time - so, no special improvements can't be expected in near future - definitely not for 6.8) For your case: /* @var $dog Dog */ $dog = $a["dog"]; Workaround exists: $dog = $a["dog"]; /* @var $dog Dog */ batch reassigning Still valid. Arrays should be support more. It's a corner case and workaround exists, as Radek wrote. You can use varDoc under the $dog = $this[...] assignment. And as it's not supported right now (and never been), it's an enhancement for me. Not even the proposed workaround is working for me. Example: public function possuiUmaOuMaisParcelasPagas($contarEntrada = true) { $entrada = $this->getRelated('parcelaEntrada'); /* @var $entrada ParcelaCobranca */ $entrada->[should show ParcelaCobranca methods but nothing happens] } Obviously I also tried to put vardoc over the assignment. It should be a BUG not enhancement since it works in some places but does not in others. |