| Summary: | Autocomplete by PHPdoc hint (comment placing) | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Emil Ivanov <emil.vladev> |
| Component: | PDT | Assignee: | PHP UI <php.ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | Sylvia Tancheva <silviya> |
| Severity: | enhancement | ||
| Priority: | P5 | CC: | gadi, ganoro, mikko.rantalainen, spektom |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
I think this is a bug. You should therefore not list this as an enhancement request. Once this bug is fixed, you need to change all your variable documentation. In addition, php documentation tools won't process comments below variables. This is critical, if not blocker! It turns out this isn't what I thought. When the comment is in format /* @var $db PDO */ it seems to work regardless of the possiotion, but when it's like /** @var $db PDO */ (note the 2nd asterik) it fails - again regardless of the possiotion. And with the second syntax I get nice coloring. I'll leave it as an enchantment request so you make it possible for both type to work or highlight the 1st format, also. *** This bug has been marked as a duplicate of bug 260330 *** Not exactly a duplicate. The already closed 'duplicate' is about /* comments */ - it is fixed and verified. The mentioned example here is about /** comment*/ which is not working. Note the double asterisk. Leaving the enhancement open. [Sylvia Tancheva] (In reply to comment #4) > Not exactly a duplicate. > The already closed 'duplicate' is about /* comments */ - it is fixed and > verified. > The mentioned example here is about /** comment*/ which is not working. Note > the double asterisk. > Leaving the enhancement open. > > [Sylvia Tancheva] Since PHP specifically declares type hints by @var in line comments (rather than in DocBlocks) I see small value in adding this enhancement as few people would use it. Moreover according to the PHPDoc @var documentation (see http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.var.pkg.html) the proposed use case is not supported BTW - this works
<?php
class A {
/**
* @var A
*/
public $myVar;
}
$a = new A();
$a->myVar->
?>
Closing according to the above comment. |
Currently, as from my observations, the PHPdoc block should be after the variable that it comments, when it comes to code in a function/method. If it's before it, the auto-complete fails to use it an display proper results. I'll give you and example. class A { function dosmth() { /** @var $db PDO */ // <- doesn't seem to work $db = someFunctionThatReturnsAPDOObject(); /** @var $db PDO *? // <- this one, though, does } }