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: | PHPDoc inline type hint | ||
---|---|---|---|
Product: | php | Reporter: | dnt |
Component: | PHPDoc | Assignee: | junichi11 |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | Cruiser, marcovtwout, timfennis, tmysik |
Priority: | P3 | Keywords: | PATCH_AVAILABLE |
Version: | 8.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
proposed patch
screenshot |
Description
dnt
2016-08-07 17:59:17 UTC
This already works, long time ago ;) (In reply to dnt from comment #0) > /** @var Type $obj */ This is incorrect! It is not a valid PHPDoc so you must use just "/*". SO, in your case it would be: /* @var Type $obj */ $obj = ...; Thanks for reporting. Thanks for the quick reply. What Netbeans supports is: /* @var $obj Type */ (variable before type) In https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md#3-definitions the type hint is written in the form I asked for: /** @var Type $obj */ It would be really helpful if Netbeans would support this as well when working together with users of other IDEs. (In reply to dnt from comment #2) > In > https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc. > md#3-definitions I see. Is this already part of PHPDoc? I see "proposed" in the URL. Thanks. It is not working in 8.2 either.. But hope it's part of the Netbeans 9 The PSR-5 is still in draft, but other editors already support this syntax. For example, PHPStorm automatically creates blocks like this: /** @var Type $name */ Would be really helpful if Netbeans can support this too! We have to note an order of a variable and types. /* @var $variable Type */ /** @var Type $variable Description */ Although I cannot promise anything, I'll try to implement it in the next version(NOT NB9.0). Thanks. Created attachment 164726 [details]
proposed patch
Support for the PHPDoc pattern.
Changes:
- Use /** @var VarType $variable */ as a template instead of /* @var $variable VarType */ (in code template and vardoc hint)
- Legacy vardoc code template abbreviation is changed to "vdocl"
- Currently, if vardoc has some whitespaces /* @var $variable VarType */, GotoDeclaration and MarkOccurrences don't work. So this is fixed in this patch.
I'll apply this patch after NetBeans 9.0 is released.
Thanks.
Created attachment 164727 [details]
screenshot
*** Bug 245913 has been marked as a duplicate of this bug. *** *** Bug 269841 has been marked as a duplicate of this bug. *** Applied the existing patch: https://github.com/apache/incubator-netbeans/pull/615 https://issues.apache.org/jira/browse/NETBEANS-942 |