Community
Participate
Working Groups
Build Identifier: 20110218-0911 as there: https://bugs.eclipse.org/bugs/show_bug.cgi?id=260330 https://bugs.eclipse.org/bugs/show_bug.cgi?id=238505 class AAA { /** * @return \AAA */ static function test() { return new static(); } } class BBB extends AAA { function showme(){} } $instance = BBB::test(); when i want query code assist, i use this to help it, but it is not working no more /** @var $instance \BBB */ /* @var $instance \BBB */ /** @var $instance BBB */ /* @var $instance \BBB */ these are all the tests i made, none works when: $instance-> ------------------------------------------- simpler test case class AAA{function hi(){}} $obj = NULL; /* @var $obj AAA */ $obj-> here i should see code assist with hi() method Reproducible: Always
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.