Bug 25313 - [content assist] Method argument guessing does not work after '('
Summary: [content assist] Method argument guessing does not work after '('
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
: 58720 85903 98448 222301 370678 426855 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-10-24 09:58 EDT by Brett Kotch CLA
Modified: 2020-03-04 17:06 EST (History)
13 users (show)

See Also:


Attachments
minimal modifications to propose methods for CompletionOnMessageSend completion request (1.38 KB, application/octet-stream)
2012-02-06 07:38 EST, Marcel Bruch CLA
no flags Details
Updated. (1.87 KB, text/plain)
2012-02-07 06:44 EST, Marcel Bruch CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brett Kotch CLA 2002-10-24 09:58:25 EDT
When I hit ctrl space on the following code:
ArrayList arrayList = new ArrayList();

int key = 0;

Object value;


arrayList.add(

I get a list of methods, in this case I get

        add(int index, object element) and

        add(object element)

If I select the first method, and hit return, it fills in the following code

        add(index, element)

as opposed to

        add(key, value)
Comment 1 Martin Aeschlimann CLA 2002-10-25 06:19:52 EDT
You have to enable Preference->Java->Editor->Code Assist-> Fill argument names
and 'Guess filled argument types'

However there is a bug: It only works when you complete at
arrayList.add
but not with
arrayList.add(

Moving to JDT.text
Comment 2 Kai-Uwe Maetzel CLA 2003-01-13 12:16:44 EST
"Unassign" PRs because of changes in staffing
Comment 3 Dani Megert CLA 2003-10-06 05:06:12 EDT
Adapting summary (see comment 1).
Comment 4 Dani Megert CLA 2005-07-06 11:31:43 EDT
*** Bug 89515 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2005-07-06 11:33:41 EDT
*** Bug 58720 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2005-07-06 11:36:43 EDT
*** Bug 98448 has been marked as a duplicate of this bug. ***
Comment 7 Dani Megert CLA 2006-03-21 08:44:03 EST
Has to be shifted to 3.3.
Comment 8 Tom Hofmann CLA 2006-05-19 11:51:16 EDT
*** Bug 85903 has been marked as a duplicate of this bug. ***
Comment 9 Markus Keller CLA 2007-06-21 07:55:51 EDT
Content assist should not only propose guesses for
    arrayList.add(|
but also for later method arguments like here:
    arrayList.add(0, |)
Comment 10 Dani Megert CLA 2008-03-12 07:57:44 EDT
*** Bug 222301 has been marked as a duplicate of this bug. ***
Comment 11 Dani Megert CLA 2008-04-18 08:15:09 EDT
No time for this. Sorry.
Comment 12 Dani Megert CLA 2012-02-06 04:48:31 EST
*** Bug 370678 has been marked as a duplicate of this bug. ***
Comment 13 Marcel Bruch CLA 2012-02-06 07:38:40 EST
Created attachment 210572 [details]
minimal modifications to propose methods for CompletionOnMessageSend completion request

I've attached a minimal patch to make method call completions on messageSend completion nodes work in certain completion contexts. I'm yet not familiar with the code but at least I *think* I've found the right location for this kind change.


Some notes/questions:

* List of overloaded methods is not displayed on top. This behavior is still wanted?
* Methods returning void are proposed. Should they be filtered?
* Should return types be considered for ranking? 
* How about primitives if reference types are expected? Filter?
* Patch is not checked for any side-effects. It's a quick test to see where to look for a solution :)
Comment 14 Dani Megert CLA 2012-02-07 05:35:35 EST
(In reply to comment #13)
> Created attachment 210572 [details]
> minimal modifications to propose methods for CompletionOnMessageSend 
> completion request

The patch does not work for me.

I used:

	void doIt(int i) {
		int a;
		int b;
		doIt(<Ctrl+Space>)
	}

==> no proposals

I would expect the same list I get after 

	void doIt(int i) {
		int a;
		int b;
		doIt<Ctrl+Space>
	}
Comment 15 Marcel Bruch CLA 2012-02-07 06:44:56 EST
Created attachment 210637 [details]
Updated.

public class Test01 {

	void oneArg(int i) {
        int a;
        int b;
        oneArg(<^space>);
    }

	void twoArgs(int i) {
        int a;
        int b;
        twoArg(a, <^space>);
    }

}


offers onearg(), twoarg(), wait(), hashcode(), clone() etc. (still no variables)
Comment 16 Marcel Bruch CLA 2012-02-07 06:48:34 EST
It's still not working properly. But before I'm going to implement the details, can ask for comments on the above questions?
Comment 17 Dani Megert CLA 2012-02-07 10:25:15 EST
(In reply to comment #16)
> It's still not working properly. But before I'm going to implement the details,
> can ask for comments on the above questions?

I thought I already did ;-).

The only proposals I'd expect to appear are those (argument guesses and parameter name) which come when completing the method.
Comment 18 Dani Megert CLA 2012-02-07 10:27:49 EST
(In reply to comment #17)
> (In reply to comment #16)
> > It's still not working properly. But before I'm going to implement the details,
> > can ask for comments on the above questions?
> 
> I thought I already did ;-).
> 
> The only proposals I'd expect to appear are those (argument guesses and
> parameter name) which come when completing the method.

i.e. we don't start to provide "normal" proposal when there's no prefix.
Comment 19 Dani Megert CLA 2014-01-29 09:58:41 EST
*** Bug 426855 has been marked as a duplicate of this bug. ***
Comment 20 Eclipse Genie CLA 2020-03-04 17:06:41 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.