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.

Bug 164696

Summary: cc: autocomplete using specification variable type using tag @var in PHPDoc syntax
Product: php Reporter: Filip Zamboj <fzamboj>
Component: EditorAssignee: Tomasz Slota <tslota>
Status: RESOLVED WORKSFORME    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Filip Zamboj 2009-05-07 15:21:35 UTC
Product Version: NetBeans IDE Dev (Build 2009-05-07_15-04-00 )
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02

description:
autocomplete using specification variable type using tag @var in PHPDoc syntax

consider: 
/** @var ArrayObject a */
$a->getIterator();

result: no cc for $a-> 
expected result: offers cc for object of ArrayObject class
Comment 1 Tomasz Slota 2009-05-16 09:46:20 UTC
*** Issue 164697 has been marked as a duplicate of this issue. ***
Comment 2 rmatous 2009-05-19 16:21:55 UTC
This syntax is supported:
/* @var $a ArrayObject */

and not:
/** @var ArrayObject a */
 
Comment 3 bobw 2010-05-21 22:47:39 UTC
(In reply to comment #2)
> This syntax is supported:
> /* @var $a ArrayObject */
> 
> and not:
> /** @var ArrayObject a */

I finally figured this out just recently. When documenting a class property, one must use the standard PHPdoc syntax:

/** @var type $variable */

but when documenting a standard variable, one must use a NB-specific syntax:

/* @var $variable type */

If you add the second * to the opening bit, add a description, or switch the order of the variable name and type, it breaks.

No wonder there's so much confusion over this!

Why this odd syntax that's incompatible with standard PHPdoc syntax?