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

Bug 144983

Summary: [misc] Javadoc Hover Non-functional
Product: [Eclipse Project] JDT Reporter: Ulrich Callmeier <eclipse>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: eclipse
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screenshot showing the broken hover
none
Screenshot showing the broken hover for a local Javadoc comment none

Description Ulrich Callmeier CLA 2006-06-01 17:08:34 EDT
The Javadoc hover doesn't work in Eclipse 3.2 RC6. It also doesn't work in RC5 and RC4. It works fine when I switch back to 3.2 M5a.

The hover window appears, but there's no content, just a white box, with a yellow area at the bottom indicating to press F2 for focus. When pressing F2, I get a completely white box.
Comment 1 Olivier Thomann CLA 2006-06-01 22:38:19 EDT
Could you please at least give some steps to reproduce?
Thanks.
Comment 2 Ulrich Callmeier CLA 2006-06-02 03:42:47 EDT
The problem is really quite fundamental. Normally, when you hover over a Java element that has associated Javadoc, that Javadoc is displayed in a small hover window. In 3.2 RC6 this window is entirely white, there's no information displayed. This is the same for all Java element.

Steps to reproduce:
1) Open any .java file
2) Position the mouse over an element with Javadoc
3) A white box appears with no information. It should contain the Javadoc.



I've tried this with 3.2 M5a, M6, RC1, RC4, RC5 and RC6. The last version that doesn't have the bug is 3.2 M5a.
Comment 3 Philipe Mulet CLA 2006-06-02 04:25:05 EDT
It works fine for us, so we need accurate steps here.
There must be something special about your setup.
Comment 4 Ulrich Callmeier CLA 2006-06-02 04:58:16 EDT
Here are exact steps to reproduce on my machine.

1) Unzip fresh Eclipse-3.2RC6 zip.
2) Start eclipse.exe
3) Point to a fresh workspace
4) Create a new Java Project
5) Create a new Class with a main() stub
6) Position the mouse cursor over the "String" type.
7) The broken hover appears. I'll attach a screenshot.

This sequence of steps produces a correct hover with 3.2M5a, but none of the following releases.

Maybe I filed this bug under the wrong category? It's probably not really a JDT problem but a problem at a more general level. Do you have any suggestions on how to help debugging this?
Comment 5 Ulrich Callmeier CLA 2006-06-02 05:05:28 EDT
Created attachment 43333 [details]
Screenshot showing the broken hover
Comment 6 Dani Megert CLA 2006-06-02 09:14:05 EDT
Does the Javadoc appear in the Javadoc view?
Anything in .log?
Comment 7 Olivier Thomann CLA 2006-06-02 10:31:06 EDT
Are you using a proxy or are you behind a firewall?
Comment 8 Ulrich Callmeier CLA 2006-06-02 11:24:23 EDT
(In reply to comment #6)
> Does the Javadoc appear in the Javadoc view?
> Anything in .log?
> 

There's nothing at all in the log.

The Javadoc doesn't appear in the Javadoc view. But then, it also doesn't appear in 3.2M5a where the hover works.
Comment 9 Ulrich Callmeier CLA 2006-06-02 11:26:58 EDT
(In reply to comment #7)
> Are you using a proxy or are you behind a firewall?
> 

I'm not using a proxy, and I am behind a firewall, but I don't see how this could be related. Note that on the exact same machine with the exact same workspace it works with 3.2M5a and doesn't work with all subsequent releases. I can switch back and forth and get this consistently: works in 3.2M5a, doesn't work in 3.2RC6, without any other change in the setup.
Comment 10 Ulrich Callmeier CLA 2006-06-02 11:59:54 EDT
Created attachment 43362 [details]
Screenshot showing the broken hover for a local Javadoc comment

Compare this to attachment 43333 [details], and you'll notice that the size of the white box that disappears corresponds to the size the actual rendered Javadoc comment would take.
Comment 11 Ulrich Callmeier CLA 2006-06-02 12:02:45 EDT
To further simplify the test case, I've inserted a local Javadoc comment for the main function (see second screenshot). I have the impression that the comment is rendered correctly, it just appears "white on white". 

So this bug probably belongs into a different area, seems to be a more low-level display problem?
Comment 12 Olivier Thomann CLA 2006-06-02 20:56:36 EDT
Moving to JDT/UI as this seems to be a coloring issue (background and foreground color are identical). Can you select the contents of the javadoc and copy it to a text editor? Just to see if you get something in the window.
Comment 13 Dani Megert CLA 2006-06-03 03:20:03 EDT
OK, what you see is a problem with the Browser widget which seems to have been in place already with 3.2 M5a. What IE version do you use?

Please check the following:
1.1. make sure Window > Preferences... > General > Web Browser is set
     to use the internal Web browser
1.2. put an URL e.g. (http://www.eclipse.org) into the text editor then
     Ctrl+Click on the URL
==> the internal web browser should open and show the web page. OK?

2.1 Make sure that you don't ignore font styles and font sizes in IE
    (should be in Tools > Internet Options... > Accessibility).
2.2. try again - does it now work?
Comment 14 Ulrich Callmeier CLA 2006-06-03 06:01:49 EDT
(In reply to comment #13)
> OK, what you see is a problem with the Browser widget which seems to have been
> in place already with 3.2 M5a. What IE version do you use?

I have IE 6.0.2900.2180.xpsp_sp2_gdr.050301-1519

> 
> Please check the following:
> 1.1. make sure Window > Preferences... > General > Web Browser is set
>      to use the internal Web browser
> 1.2. put an URL e.g. (http://www.eclipse.org) into the text editor then
>      Ctrl+Click on the URL
> ==> the internal web browser should open and show the web page. OK?

The browser was set to internal. Opening the URL works fine, the Eclipse home page was displayed fine.

> 
> 2.1 Make sure that you don't ignore font styles and font sizes in IE
>     (should be in Tools > Internet Options... > Accessibility).

This was already the case.

> 2.2. try again - does it now work?

Unfortunately not. I played around a bit with the various options, and found that I can change the background color of the hover by setting the Background Color in Tools -> Internet Options -> Colors. Unfortunately, setting the Text color has no effect. I tried several combinations with different font, color and accessibility settings, and the hover display is always just the background color.

There's also no text in the hover that I could copy (as was suggested in comment  #12). So it seems the size of the hover is calculated correctly, and the background color is set, but then no text is put in.

Any other ideas for debugging? This must be related to some change between M5a and M6, since it consistently works for me with M5a, and doesn't work with M6 and subsequent releases.
Comment 15 Dani Megert CLA 2006-06-03 08:16:00 EDT
>This must be related to some change between M5a
>and M6, since it consistently works for me with M5a, and doesn't work with M6<
>and subsequent releases.
Yes, we switched to use the Browser widget which seems to not have worked in your environment even in M5a since the Javadoc view doesn't work there. Does the Javadoc view work using 3.1.2?

>Any other ideas for debugging?
If you know how to debug an Eclipse application you could put a breakpoint into Browser.setText(String). The control which is responsible to show the Javadoc hover is BrowserInformationControl.
Comment 16 Ulrich Callmeier CLA 2006-06-03 14:17:37 EDT
(In reply to comment #15)

> If you know how to debug an Eclipse application you could put a breakpoint into
> Browser.setText(String). The control which is responsible to show the Javadoc
> hover is BrowserInformationControl.

I think I managed to setup what's required for Eclipse debugging. What happens when I hover over the "String" in my test case looks interesting. There are two calls to Browser.setText(), the first one with reasonable looking HTML, the second one with almost-empty HTML:

<html><body style="overflow:hidden;" style="word-wrap: break-word;" ></html>

Both calls are to the same Browser instance. The two call stacks are:

The first:

Thread [main] (Suspended (breakpoint at line 1270 in Browser))	
	Browser.setText(String) line: 1270	
	BrowserInformationControl.setInformation(String) line: 324	
	TextViewerHoverManager(AbstractInformationControlManager).internalShowInformationControl(Rectangle, Object) line: 860	
	TextViewerHoverManager(AbstractInformationControlManager).presentInformation() line: 837	
	TextViewerHoverManager(AbstractHoverInformationControlManager).presentInformation() line: 502	
	TextViewerHoverManager.doPresentInformation() line: 231	
	TextViewerHoverManager$5.run() line: 221	
	RunnableLock.run() line: 35	
	UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 123	
	Display.runAsyncMessages(boolean) line: 3325	
	Display.readAndDispatch() line: 2971	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1914	
	[...]

The second:

Thread [main] (Suspended (breakpoint at line 1270 in Browser))	
	Browser.setText(String) line: 1270	
	BrowserInformationControl.setInformation(String) line: 324	
	BrowserInformationControl.setVisible(boolean) line: 355	
	TextViewerHoverManager(AbstractInformationControlManager).hideInformationControl() line: 930	
	TextViewerHoverManager.hideInformationControl() line: 331	
	AbstractHoverInformationControlManager$Closer.stop(boolean) line: 142	
	AbstractHoverInformationControlManager$Closer.stop() line: 126	
	AbstractHoverInformationControlManager$Closer.shellDeactivated(ShellEvent) line: 242	
	TypedListener.handleEvent(Event) line: 168	
	EventTable.sendEvent(Event) line: 66	
	Shell(Widget).sendEvent(Event) line: 928	
	Shell(Widget).sendEvent(int, Event, boolean) line: 952	
	Shell(Widget).sendEvent(int) line: 933	
	Shell(Decorations).WM_ACTIVATE(int, int) line: 1588	
	Shell.WM_ACTIVATE(int, int) line: 1714	
	Shell(Control).windowProc(int, int, int, int) line: 3244	
	Shell(Decorations).windowProc(int, int, int, int) line: 1539	
	Shell.windowProc(int, int, int, int) line: 1634	
	Display.windowProc(int, int, int, int) line: 4025	
	OS.PeekMessageW(MSG, int, int, int, int) line: not available [native method]	
	OS.PeekMessage(MSG, int, int, int, int) line: 2387	
	Display.readAndDispatch() line: 2963	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1914	
	[...]

So to me it loooks like the "good" first hover is immediately overwritten by the empty second one. Maybe you can see immediately what's happening here? I don't quite see why the second setText call is issued.
Comment 17 Ulrich Callmeier CLA 2006-06-03 14:24:02 EDT
(In reply to comment #16)

> So to me it loooks like the "good" first hover is immediately overwritten by
> the empty second one. Maybe you can see immediately what's happening here? I
> don't quite see why the second setText call is issued.

It seems this is just an artefact of debugging. It doesn't work either if I disable the second call - it seems because the host Eclipse triggers the breakpoint and goes to the foreground, the target Eclipse receives an event so the hover is closed.
Comment 18 Ulrich Callmeier CLA 2006-06-03 16:01:16 EDT
After some more debugging, I think the main problem is that the OleListener that's instantiated for the Browser never receives the DocumentComplete event it's waiting for. It receives quite a number of StatusTextChange events, but no DocumentComplete, so it never draws anything besides the about:blank page...

Any idea why this is happening?

Comment 19 Ulrich Callmeier CLA 2006-06-03 16:17:09 EDT
I was able to get the correct Javadoc displayed in the window that appears after one presses F2 by calling the code that's normally run from the OLE event handler for DocumentCompleted from the StatusTextChange event.

While this is not any kind of solution, it seems to confirm that the underlying problem is that I don't receive the DocumentCompleted OLE event. 

Any ideas?
Comment 20 Ulrich Callmeier CLA 2006-06-04 02:59:03 EDT
Now that I had the right search terms, I was able to find that this problem had been submitted previously as bug 141678. I'm closing this one now.

*** This bug has been marked as a duplicate of 141678 ***