Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323960 - [PHP 5.3] Hover Class aliases -> no tooltip + missing go-to-source
Summary: [PHP 5.3] Hover Class aliases -> no tooltip + missing go-to-source
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Zhongwei Zhao CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-30 08:10 EDT by Sylvia Tancheva CLA
Modified: 2020-05-14 11:07 EDT (History)
2 users (show)

See Also:
ganoro: review+
qiangsheng.w: review+
zhaozhongwei: review? (zhaozhongwei)


Attachments
patch (1.14 KB, patch)
2010-09-05 08:53 EDT, Zhongwei Zhao CLA
no flags Details | Diff
Alternative (959 bytes, application/octet-stream)
2010-09-05 20:31 EDT, Q.S. Wang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvia Tancheva CLA 2010-08-30 08:10:27 EDT
1. Create a PHP 5.3 project
2. Create 2 php files with the code below.
3. In caller.php file point the "L" in "L\MYCONST" or "L\MyFunction()" -> you get a tooltip showing App\Lib1 (OK)
4. Ctrl+click on the "L" -> App\Lib1 in lib1.php file is selected (OK)
5. Now repeat steps 3 and 4 for "Obj" in "Obj::WhoAmI()" -> no tooltip is shown plus ctrl+click is not available

lib1.php:
=========
<?php
// application library 1
namespace App\Lib1;

const MYCONST = 'App\Lib1\MYCONST';

function MyFunction() {
	return __FUNCTION__;
}

class MyClass {
	static function WhoAmI() {
		return false;
	}
}
?>

caller.php:
============
<?php
use App\Lib1 as L;
use App\Lib1\MyClass as Obj;

require_once('lib1.php');
//require_once('lib2.php');

header('Content-type: text/plain');
echo L\MYCONST . "\n";
echo L\MyFunction() . "\n";
echo Obj::WhoAmI() . "\n";

?>
Comment 1 Zhongwei Zhao CLA 2010-09-05 08:53:00 EDT
Created attachment 178227 [details]
patch
Comment 2 Q.S. Wang CLA 2010-09-05 20:30:39 EDT
I think that there's not need of the if statement. The getRealName should handle the alias/type name already.

I created a new patch.
Comment 3 Q.S. Wang CLA 2010-09-05 20:31:13 EDT
Created attachment 178232 [details]
Alternative
Comment 4 Zhongwei Zhao CLA 2010-09-06 00:35:02 EDT
Hi QS
yes,you are right,thanks,your patch is better than mine.
Comment 5 Zhongwei Zhao CLA 2010-09-06 01:20:00 EDT
fixed
Comment 6 Zhongwei Zhao CLA 2010-09-06 01:20:35 EDT
change status
Comment 7 Zhongwei Zhao CLA 2010-09-13 02:29:25 EDT
the following case does not work
<?php
namespace ns1\n\a;
class CCC{

}

namespace ns1;

use ns1\n as m;

$v = new m\a\CCC();
Comment 8 Zhongwei Zhao CLA 2011-05-19 02:23:04 EDT
fixed in head
Comment 9 Sylvia Tancheva CLA 2011-07-13 09:31:45 EDT
Verified with Studio 9 #179. Closing.

Ilina Stefanova