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

Bug 387078

Summary: Need to show Javadoc of called method parameter from caller parameter
Product: [Eclipse Project] JDT Reporter: Glenview Jeff <junk>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, olejorgenb, srikanth_sankaran
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Glenview Jeff CLA 2012-08-12 09:13:37 EDT
Suppose I have the following code:

void foo(int i) {}
void bar() {
   foo(1);
}

If I hover over the 1, I would like to see "int i" as I do if I hover over "foo".  I know this can conflict with showing the Javadocs of methods or fields in the parameter such as how presently Eclipse shows on hover the Javadoc for random() below:

void bar() {
   foo(random());
}

Perhaps there could be a hover modifier key to override this and a precedence order to determine which Javadoc is displayed in this case.
Comment 1 Srikanth Sankaran CLA 2012-08-12 20:56:41 EDT
Forward to UI for comment.
Comment 2 Dani Megert CLA 2012-08-13 05:24:01 EDT
You can use Ctrl+Shift+Space to get the parameter hints. We don't plan to show this in an additional hover.
Comment 3 Glenview Jeff CLA 2012-08-13 11:29:53 EDT
I am reopening this, as control-shift space just shows the entire signature of the method and does so without Javadoc.

Often when looking at method calls with many parameters, I'd need to know what a particular parameter's purpose is by reading its Javadoc.  Presently I have to  counting the number of parameters until I reach the one of interest, then I have to hover over the method name and count again. 

This doesn't necessarily have to be performed with a mouse hover--though I'd prefer it--a keyboard shortcut would be okay.
Comment 4 Glenview Jeff CLA 2012-08-13 11:51:55 EDT
Incidentally, IntelliJ uses control-P to do to this.
Comment 5 Dani Megert CLA 2012-08-14 03:53:59 EDT
We don't want to add a hover. The fix for bug 385642 will probably address your request as you could open the Javadoc view via key binding (if it is not yet open).

*** This bug has been marked as a duplicate of bug 385642 ***
Comment 6 Ole Jørgen CLA 2012-08-16 07:43:13 EDT
Kind of a workaround/similar feature is:

foo(34, bar1, <cursor>bar2)

press ctrl-space

This shows the method signature above with the formal parameter corresponding to bar2 highlighted.

(in juno at least, not sure above 3.8)

PS: Not sure how this is a duplicate of #385642 ...
Comment 7 Glenview Jeff CLA 2012-08-16 10:06:32 EDT
It would be a great workaround since usually the parameter names are self-documenting, but there's no highlighting of the parameter (bar2 in your example) in Indigo.