Bug 94705 - [hovering] Javadoc hover's trigger region exceeds right side
Summary: [hovering] Javadoc hover's trigger region exceeds right side
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 81129 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-11 09:59 EDT by Christof Marti CLA
Modified: 2006-05-10 09:53 EDT (History)
3 users (show)

See Also:


Attachments
Screenshot of type hover (8.38 KB, image/jpeg)
2005-05-11 10:05 EDT, Christof Marti CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christof Marti CLA 2005-05-11 09:59:18 EDT
I20050509-2010 (MacOS X and Windows XP)

Hovering over a type declaration with an 'unimplemented method' error shows the type hover when 
hovering over the right border of the type name. I would expect the error hover to completely hide the 
type hover.
Comment 1 Christof Marti CLA 2005-05-11 10:05:29 EDT
Created attachment 20962 [details]
Screenshot of type hover

That is, when using a large font.
Comment 2 Dani Megert CLA 2005-05-11 11:35:34 EDT
I've debugged this: ICodeAssist.codeSelect(...) returns a type even if the
offset is pointing to the space after the type
Comment 3 Dani Megert CLA 2005-05-27 04:10:12 EDT
*** Bug 81129 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2006-04-25 11:04:04 EDT
This makes hyperlinking look ugly, especially when using upcoming builds (>N20060425-0010) where we fixed some text measuring issues. I assume the fix is quite simple. Could this be addressed for 3.2?

Test Case using N20060426-0010 or newer:
1. select a large Java editor font (e.g. 20pt)
2. add a CU with only the following text:
/** String        */
3. Ctrl+Move the mouse from the right side towards the 'String'
==> we get the hand cursor one offset too early.
Comment 5 David Audel CLA 2006-04-25 12:38:34 EDT
The fix seems easy. I just need to replace 
'scanner.startPosition <= selectionStart && selectionStart <= scanner.currentPosition'
by
'scanner.startPosition <= selectionStart && selectionStart < scanner.currentPosition'
in SelectionEngine#checkSelection(...)

But if i do that the following test case will not work
1) class X implements Runnable {}
2) put the caret just after Runnable
'class X implements Runnable| {}'
3) do F3
Currently code select return the Runnable element.
But if i apply the fix, code select will return nothing in this case.

It's not possible two have both behaviors in JDT/Core (unless we add a new API).

Daniel - Do you think it is possible to have both behaviors by changing something on your side ?
Comment 6 Philipe Mulet CLA 2006-04-25 12:49:50 EDT
Feels like a contract change in our layer if we do what is asked here.
Comment 7 Dani Megert CLA 2006-04-25 12:50:48 EDT
Discussed with David: we mention this case in the Javadoc (improve it) and leave codeSelect(...) as is. Now that we know the contract we can adjust the UI where appropriate.
Comment 8 David Audel CLA 2006-04-25 13:03:27 EDT
I will update the Javadoc to describe this contract. I entered a bug for that (bug 138432)

Move to JDT/Text
Comment 9 Philipe Mulet CLA 2006-04-25 13:14:43 EDT
Just a corner case:

ABC DEF (one space in between)

Is the hover going to show info for DEF as soon as escaping from ABC ? (when hovering in space area)
Comment 10 Dani Megert CLA 2006-04-25 14:08:12 EDT
>Is the hover going to show info for DEF as soon as escaping from ABC ? (when
>hovering in space area)
No, it should dismiss the hover.
Comment 11 Dani Megert CLA 2006-04-25 14:22:26 EDT
Fixed hovering and hyperlinking in HEAD.
Available in builds > N20060425-0010.
Comment 12 Tom Hofmann CLA 2006-05-10 09:53:37 EDT
Verified in 3.2RC3