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

Bug 322556

Summary: [hovering] Quick Fix hover cuts message
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, markus.kell.r
Version: 3.7   
Target Milestone: 3.8 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 365961    
Bug Blocks:    
Attachments:
Description Flags
Screenshot none

Description Markus Keller CLA 2010-08-12 11:55:49 EDT
Created attachment 176481 [details]
Screenshot

I20100810-0800

Quick Fix hover cuts message on the constructor invocation: 

package xy;

class InfixExpression { }
class ASTNode { }
class AssociativeInfixExpressionFragment {
    AssociativeInfixExpressionFragment() {
        InfixExpression ie= null;
        java.util.List<ASTNode> list= null;
        Object o= new AssociativeInfixExpressionFragment(ie, list);
    }
}
Comment 1 Dani Megert CLA 2010-08-13 02:16:48 EDT
Hover cutting was always a problem, even when back in the days where we had the simple hover (see bug 171047).
Comment 2 Markus Keller CLA 2010-08-13 09:14:33 EDT
Bug 171047 is about completely different code and about a non-default font. The relationship to this bug is quite far-fetched. The fact that the old code also had bugs does not make this minor. In the example, the message makes no sense.
Comment 3 Markus Keller CLA 2012-03-08 05:53:07 EST
Even after bug 365961 is fixed, the hover still looks bad in this case ("Incomplete 'switch' cases on enum" set to Warning):

    void foo(Thread.State state) {
        switch (state) {
            case BLOCKED:
                System.out.println("Hi");
                break;
            case NEW:
                System.out.println("Ho");
                break;
//            default:
//                System.out.println("No");
//                break;
        }
        System.out.println("Go");
    }

Problem is that Shell#computeSize(..) adds trims to the given wHint, so the result is always larger than requested.

Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=7e3d7066d9916b05de7e57fdd20a355cd1a0b82e
Comment 4 Markus Keller CLA 2012-04-12 17:56:21 EDT
Works fine now.