| Summary: | @var not working to help code assist | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Giorgio Liscio <giorgio.liscio> |
| Component: | PDT | Assignee: | PHP Core <php.core-inbox> |
| Status: | CLOSED FIXED | QA Contact: | Ilina Stefanova <ilina.s> |
| Severity: | major | ||
| Priority: | P3 | CC: | ganoro |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Giorgio Liscio
sorry, the previous example works
here is the corrected testcase
class AAA{static function getInstance(){ return new static();}}
class BBB extends AAA{function showme(){}}
$aaa = BBB::getInstance();
/** @var $aaa \Atom\BBB */
$aaa->
after investigation,I found /* @var $aaa \Atom\BBB */ works fine,but /** @var $aaa \Atom\BBB */ does not! /** xxxx */ is phpdoc,for tags in it,we should use /** * @var \Atom\BBB */ instead of /** @var $aaa \Atom\BBB */ more then 1 line,and no variable name. But now we still do not support it even you use: /** * @var \Atom\BBB */ I will ask Roy if we should support it. But I think /* @var $aaa \Atom\BBB */ is enough! (In reply to comment #2) > after investigation,I found /* @var $aaa \Atom\BBB */ works fine,but /** @var > $aaa \Atom\BBB */ does not! > /** xxxx */ is phpdoc,for tags in it,we should use > > /** > * @var \Atom\BBB > */ > instead of /** @var $aaa \Atom\BBB */ > more then 1 line,and no variable name. > > But now we still do not support it even you use: > /** > * @var \Atom\BBB > */ > > I will ask Roy if we should support it. > But I think /* @var $aaa \Atom\BBB */ is enough! The PHP lexer is the one to define the type hinting syntax. and according to it the only supported form is /* @var ... */ So we should not support the other annotation. Thanks! the problem is not the annotation, this is not working with ANY annotation
(still with latest pdt build)
class AAA{static function getInstance(){ return new static();}}
class BBB extends AAA{function showme(){}}
$aaa = BBB::getInstance();
/**
* @var $aaa \Atom\BBB
*/
$aaa-> {here i should see showme(), but it is not here)
try this
namespace Atom
{
class AAA{static function getInstance(){ return new static();}}
class BBB extends AAA{function showme(){}}
$aaa = BBB::getInstance();
/**
* @var $aaa \Atom\BBB
*/
$aaa-> {here i should see showme(), but it is not here)
}
hey,you should use /* @var $aaa \Atom\BBB */ $aaa-> instead of /** * @var $aaa \Atom\BBB */ $aaa-> for the last time, NO, it does not work with ANY of the proposed notations where is the difficulty to copy-paste my test case and see with your eyes that NO ONE of the proposed notations works? hmmm,it works fine in my development environment,not sure if you try the latest nightly build version. give me the code that works thanks <?php
namespace Atom {
class AAA {
static function getInstance() {
return new static ();
}
}
class BBB extends AAA {
function showme() {
}
}
$aaa = BBB::getInstance ();
/* @var $aaa \Atom\BBB */
$aaa->
}
ok, in my build (latest stable) is not working at all where i can get the trunk (windows, precompiled) ? thank you I build a new one just now,https://hudson.eclipse.org/hudson/job/cbi-pdt-3.0-indigo/126/artifact/build/N201105292225/pdt-SDK-N201105292225.zip verified resolved in eclipse 3.7 pdt 3.0 thank you Zhao's comment 10 is verified. Closing. |