Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327514

Summary: @var type hinting doesn't work for namespaced classes
Product: z_Archived Reporter: Axel <staff>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED FIXED QA Contact: Ilina Stefanova <ilina.s>
Severity: normal    
Priority: P1 CC: ganoro, kalin.a, mb, third-chance
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Example of broken autocompletion
none
patch none

Description Axel CLA 2010-10-12 02:54:09 EDT
Build Identifier: 20100617-1415

Typginting a variable using the @var comment syntax does not work for namespaced classes.
Neither for classes imported by use nor full qualified class names.

Reproducible: Always

Steps to Reproduce:
Assume that \foo\MyClass is declared an available:

FQ class names dont work:

<?php
/* @var $foo \foo\MyClass */
$foo->|
?>

Imported class with use does not work:
<?php
use foo;
/* @var $foo foo\MyClass */
$foo->|
?>

<?php
use foo\MyClass;
/* @var $foo MyClass */
$foo->|
?>


But this works:
<?php
use foo;

$foo = new foo\MyClass();
$foo->|
?>

<?php
$foo = new \foo\MyClass();
$foo->|
?>
Comment 1 Axel CLA 2010-10-12 02:59:01 EDT
Created attachment 180639 [details]
Example of broken autocompletion
Comment 2 xu jiaxi CLA 2010-10-17 23:19:48 EDT
Created attachment 181056 [details]
patch
Comment 3 T3rm1 CLA 2010-10-25 05:27:32 EDT
Could you include the provided patch into the next milestone or update please. Code completion is one of the core features an IDE has.
I need this update asap. Thanks.
Comment 4 avalon CLA 2010-11-21 17:31:26 EST
Any news on this issue?

In pdt-Update-M201010110334 it does not work for @var-comments in procedural PHP as well as in namespaces class-methods.
Curiously it works in non-namespaced class-methods.
Comment 5 Roy Ganor CLA 2010-11-22 02:21:25 EST
(In reply to comment #4)
> Any news on this issue?
> 
> In pdt-Update-M201010110334 it does not work for @var-comments in procedural
> PHP as well as in namespaces class-methods.
> Curiously it works in non-namespaced class-methods.

According to the process we follow, the patch needs to be reviewed and then committed to head. We will then release an update site for Indigo...
Comment 6 T3rm1 CLA 2010-12-14 05:43:47 EST
(In reply to comment #5)
> (In reply to comment #4)
> > Any news on this issue?
> > 
> > In pdt-Update-M201010110334 it does not work for @var-comments in procedural
> > PHP as well as in namespaces class-methods.
> > Curiously it works in non-namespaced class-methods.
> 
> According to the process we follow, the patch needs to be reviewed and then
> committed to head. We will then release an update site for Indigo...

So if I understand correctly we don't get a patch for the Helios release?
Has this patch been reviewed yet?
Comment 7 Axel CLA 2010-12-17 16:37:13 EST
(In reply to comment #6)
> So if I understand correctly we don't get a patch for the Helios release?
> Has this patch been reviewed yet?

I would appreciate a fix in Helios.
Comment 8 Zhongwei Zhao CLA 2011-04-19 01:36:13 EDT
change status
Comment 9 Zhongwei Zhao CLA 2011-04-19 01:44:22 EDT
*** Bug 327511 has been marked as a duplicate of this bug. ***
Comment 10 Kalin CLA 2011-07-28 03:04:41 EDT
Verified.
Closing...