Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327514 - @var type hinting doesn't work for namespaced classes
Summary: @var type hinting doesn't work for namespaced classes
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P1 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact: Ilina Stefanova CLA
URL:
Whiteboard:
Keywords:
: 327511 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-12 02:54 EDT by Axel CLA
Modified: 2020-05-14 10:16 EDT (History)
4 users (show)

See Also:


Attachments
Example of broken autocompletion (34.99 KB, image/jpeg)
2010-10-12 02:59 EDT, Axel CLA
no flags Details
patch (2.24 KB, patch)
2010-10-17 23:19 EDT, xu jiaxi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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...