Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324656 - links to types and methods not working in PHPDoc tooltip
Summary: links to types and methods not working in PHPDoc tooltip
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jacek Pospychala CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 324636
  Show dependency tree
 
Reported: 2010-09-07 09:43 EDT by Jacek Pospychala CLA
Modified: 2020-05-14 11:16 EDT (History)
4 users (show)

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


Attachments
patch (17.16 KB, patch)
2010-09-07 09:47 EDT, Jacek Pospychala CLA
no flags Details | Diff
patch (24.53 KB, patch)
2010-09-09 07:02 EDT, Jacek Pospychala CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Pospychala CLA 2010-09-07 09:43:15 EDT
for file:

<?php


/**
 * Enter description here ...
 * @author jacek
 */
class Abc  {

	/**
	 * asdasd
	 * 
	 * @see Abc
	 */
	public function doStuff() {
	}
}

class Def extends Abc {
	
	/**
	 * Do more and better stuff!
	 * 
	 * @see Abc::doStuff()
	 */
	public function doStuff() {
		
	}
}

?>

Move mouse over Def::doStuff to see it's tooltip.
Notice that there are links to Abc::doStuff and Abc type. Clicking them doesn't work. On some platforms it opens empty page in tooltip and on other it opens some directory contents.
Comment 1 Jacek Pospychala CLA 2010-09-07 09:47:25 EDT
Created attachment 178323 [details]
patch

Patch is based on JDT.

PHPDocumentationContentAccess.createSimpleMemberLink already had JDT-based impl commented out, so I uncommented it.
PHPElementLinks class was added analogously to JavaElementLinks from JDT, except that it's much simpler and uses PHP api (DltkCore and PHPUiPlugin), instead of JDT.
PHPDocumentationHover was changed to hook PHPElementLinks.ILinkHandler to tooltip's browser
Comment 2 Jacek Pospychala CLA 2010-09-07 09:48:42 EDT
guys, please take a look at the patch.
IMHO it's not very risky, because previously links were not working at all.
Comment 3 Jacek Pospychala CLA 2010-09-09 07:02:41 EDT
Created attachment 178503 [details]
patch

patch improved to correctly parse the URI with referenced element information. Compared to previous patch, main difference is PHPElementLinks.parseURI()
Comment 4 Zhongwei Zhao CLA 2010-09-10 22:30:53 EDT
reviewed
Comment 5 Roy Ganor CLA 2010-09-12 18:02:11 EDT
Applied to branch and head
Comment 6 Jacek Pospychala CLA 2010-09-13 03:47:16 EDT
marking as fixed.
Comment 7 Sylvia Tancheva CLA 2010-09-14 10:40:53 EDT
Verified on Win/Lin/MAC - works now.
Closing
Comment 8 Mauro Molinari CLA 2010-10-20 02:00:34 EDT
What is the target milestone of this? I'm using the following:

PHP Development Tools (PDT) SDK Feature	2.2.1.v20101001-2300-53184QAN4JBQgLYPWMLcXn6Na9Od	org.eclipse.php.sdk.feature.group

Is it supposed to contain this fix? I see that it contains the fix for bug #324636 but the rendered links do not work for me.
Comment 9 Sylvia Tancheva CLA 2010-10-20 03:23:43 EDT
(In reply to comment #8)
> What is the target milestone of this? I'm using the following:
> 
> PHP Development Tools (PDT) SDK Feature   
> 2.2.1.v20101001-2300-53184QAN4JBQgLYPWMLcXn6Na9Od   
> org.eclipse.php.sdk.feature.group
> 
> Is it supposed to contain this fix? I see that it contains the fix for bug
> #324636 but the rendered links do not work for me.

Hi
I also have the 2.2.1.v20101001 and this works OK there.
When you click on the link the in the doc-tip the content changes.
Do you mean that you expected to be moved to the relevant place in the code?
Because if so I am not sure that is the way it is supposed to work. It only changes the content of the doc-tip.
Comment 10 Mauro Molinari CLA 2010-10-21 04:17:23 EDT
(In reply to comment #9)
> When you click on the link the in the doc-tip the content changes.
> Do you mean that you expected to be moved to the relevant place in the code?

No, the problem here is that when I click on the link, nothing happens (=> the content doesn't change).

I'll try to post a simple test case here where I have this problem.
Comment 11 Sylvia Tancheva CLA 2010-10-21 04:26:10 EDT
Example will be good.
Also what is your OS?
Comment 12 Mauro Molinari CLA 2010-10-22 02:05:36 EDT
(In reply to comment #11)
> Example will be good.
> Also what is your OS?

This is a very simple tast case that fails for me:
class Test
{
	/**
	 * @see ab()
	 */
	public function aa()
	{

	}
	
	/**
	 * @see Test::aa()
	 */
	public function ab()
	{
		
	}
}

If I hit F2 on aa I see the link to ab, but if I click it does not change the contents of the phpDoc window. Same for ab.

Other info:
PHP Development Tools (PDT) SDK Feature	2.2.1.v20101001-2300-53184QAN4JBQgLYPWMLcXn6Na9Od	org.eclipse.php.sdk.feature.group
Eclipse 3.6.1 build M20100909-0800
Windows Vista 32-bit
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.6.0_22-b04
workspace is in D:\workspace-mauro
The test project I created is named "Test bug 324656", so it's located in "D:\workspace-mauro\Test bug 324656"
Comment 13 Sylvia Tancheva CLA 2010-10-22 03:12:43 EDT
OK ... so what I see is the following:
1. If you have @see <class_name>::<method_name> it works.
In your case it works for:
    /**
     * @see Test::aa()
     */
    public function ab()
    {

    }
2. If you have @see <method_name> (without <class_name>) it does not work.
In your case:
    /**
     * @see ab()
     */
    public function aa()
    {

    }
So I guess we need to check if the second one is a valid case.
Jacek, Zhao what do you think?
Comment 14 Jacek Pospychala CLA 2010-10-22 03:20:58 EDT
Mauro and Silvia,
thanks for investigating this! 
I opened bug 328432 for the not working case.