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

Bug 339221

Summary: [content assist] ',' does not jump to the next argument
Product: [Eclipse Project] JDT Reporter: Deepak Azad <deepakazad>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix 2 none

Description Deepak Azad CLA 2011-03-08 08:30:48 EST
--------------------------------
void bar(int a, int b) {

}

void foo() {
	bar<ctrl+space><,>	
}
------------------------------

In the above snippet ',' does not jump to the next argument. However if I define 'a' and 'b' in foo then ',' jumps to the next argument.

Don't know if it matters but I had 'Fill method arguments' preference enabled and 'Insert parameter names' selected.
Comment 1 Markus Keller CLA 2011-03-08 09:06:02 EST
>     bar<ctrl+space><,>    
Keys are: Ctrl+Space, Enter, ','

> Don't know if it matters but I had 'Fill method arguments' preference enabled
> and 'Insert parameter names' selected.
Yes, that makes the difference.

Fixed in HEAD of ParameterGuesser.


Filed bug 339224 for cases where no proposal popup is shown.
Comment 2 Markus Keller CLA 2011-03-16 09:38:52 EDT
Created attachment 191300 [details]
Fix 2

The initial fix was not handy in case the user decides to add more arguments to the method invocation:

public class Try {
    String foo(String str, int end) {
        // content assist, Enter, press Left, type "0, ":
        return str.subs
    }
    
    void bar(int x, int y, int[] xs, int[] ys) {
        // content assist, Tab, type "x, ":
        takeInts
    }
    
    void takeInts(int a, int... more) {
        
    }
}

The patch fixes this by not using ',' as trigger character in the last argument. Fixed in HEAD.