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

Bug 370678

Summary: Propose method arguments on empty prefix
Product: [Eclipse Project] JDT Reporter: Marcel Bruch <marcel.bruch>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, deepakazad, lerch
Version: 3.8   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot showing completion on method arguments with emtpy prefix none

Description Marcel Bruch CLA 2012-02-06 01:43:28 EST
Created attachment 210550 [details]
Screenshot showing completion on method arguments with emtpy prefix

When triggering code completion in method bodies w/o prefix, it proposes all locals, methods and fields visible at the current completion position:


void m(){
|<^Space> --> all visible locals, fields, methods are proposed



When triggering code completion on method arguments as in 

void m(){
  x.call(|<^Space)
}

it only shows the signature of the method you have chosen , and in the case x.call is an overloaded method all its variants, but not any visible local, field, or method. They are proposed only after the first character is typed:

String field;

void m(){
  x.call(f|<^Space) --> may propose "field"
}


From my observation, this behavior is confusing and additionally requires me to remember which variable or method I want to invoke from the early beginning. With this behavior code completion looses its function as a explorer for "what can I can do here?".

Since completions with empty prefixes are supported in other positions I wonder if  there is any reason why proposing variables and methods in method arguments shouldn't be proposed too with empty prefixes (probably below the list of methods I'm potentially going to use).


If there is no reason, I'd like to propose this as change for 3.8/4.2.
Comment 1 Johannes Lerch CLA 2012-02-06 04:31:49 EST
+1
Comment 2 Dani Megert CLA 2012-02-06 04:48:31 EST
> If there is no reason, I'd like to propose this as change for 3.8/4.2.

Patch is welcome.

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