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 - cc: autocomplete using specification variable type using tag @var in PHPDoc syntax
Summary: cc: autocomplete using specification variable type using tag @var in PHPDoc s...
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
: 164697 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-07 15:21 UTC by Filip Zamboj
Modified: 2010-05-21 22:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?