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 187317 - inline phpdoc /* @var */
Summary: inline phpdoc /* @var */
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on: 156212
Blocks:
  Show dependency tree
 
Reported: 2010-06-08 10:36 UTC by mishak
Modified: 2012-10-16 08:22 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mishak 2010-06-08 10:36:04 UTC
Please extend syntax highlighting for documentation keywords to simple comments:

 /* @var $abc TYPE */

support for @var is already implemented (http://netbeans.org/bugzilla/show_bug.cgi?id=156212) also having TYPE in different color would be nice.

Thanks
Comment 1 VosslerTux 2011-03-07 14:49:53 UTC
I add two points with phpdoc /* @var */

First it's just a problem of syntax coloration. 
In your documentation (http://netbeans.org/kb/docs/php/editorguide.html) you use /* @var $variable Object */ to define a variable as an object. 
But when I write this in my netbeans (6.9.1) "@var" not appear in bold, on the other hand when I write /** @var $variable Object */ "@var" is in bold. 
The real syntax is /* @var $variable Object */ (like in your documentation) not /** @var $variable Object */ with two ** the completion doesn't work. 
So the problem is just the "@var" is not in bold with the real syntax. It's not very important but I underline this point. 

The second problem is more important for me. 
I use two class for exemple, Object1 and Object2 

class Object1 
{ 
public $var1; 
public $var2; 
} 

class Object2 
{ 
/* @var $objectOne Object1 */ 
public $objectOne; 
public $var3; 

} 

In the second class I declare the variable $objectOne like an object Object1 with your phpDoc syntax. 
If in the class I write in a function : $this->objectOne-> 
objectOne is not considered as an object and Netbeans doesn't propose completion. But if I write: $objectOne-> 
it's work and NetBeans propose var1 and var2. So with $this it's doesn't work but without yes. It's Strange. 
So when I use a object Object2 in my project, I never have the autocompletion for the field objectOne. 

Thanks



(In reply to comment #0)
> Please extend syntax highlighting for documentation keywords to simple
> comments:
> 
>  /* @var $abc TYPE */
> 
> support for @var is already implemented
> (http://netbeans.org/bugzilla/show_bug.cgi?id=156212) also having TYPE in
> different color would be nice.
> 
> Thanks
Comment 2 Ondrej Brejla 2012-10-16 08:22:04 UTC
For class fields, you have to use classic PHPDoc format /** @var Type */. VARDoc type is used just "inline" for a virtually defined types...when NetBeans can't infer a proper type. And @var is bold in 7.3 even in VarDoc type ;)