Bug 222301 - [content assist] It should be possible to fill default constructor arguments
Summary: [content assist] It should be possible to fill default constructor arguments
Status: RESOLVED DUPLICATE of bug 25313
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-11 16:04 EDT by Max Gilead CLA
Modified: 2008-03-12 07:57 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Gilead CLA 2008-03-11 16:04:08 EDT
I believe it should be possible to fill default constructor arguments from template proposals just as it happens with methods. To be exact I'll describe the difference.

Let's say we have this piece of code:
public class Test {
	public Test(int a, int b) {}
	public void foo(int c, int d) {}
	public void test() {
	// testing area ;)
	
	}
}

What happens for method:
Place your cursor in the testing area and type 'fo' Ctrl+Space, Enter. What you get is: 'foo(c, d)' -- a method invocation with parameter names filled in.

What happens for constructor:
Place your cursor in the testing area and type 'new Te' Ctrl+Space, Enter. What you get is: 'new Test'. OK, that was a class name. Now type '(' and press Ctrl+Space again for constructors list. If you press Enter instead of filed argument names (as was with the method above) you get a help popup (helpful, granted, but that's not the point).

There seems to be no way to auto-fill constructor argument names. I believe there should be a way to auto-fill argument names from the 'Proposals' window or to turn that help popup into argument names list. Current behavior seems inconsistent. Why are methods better than constructors? :)

Eclipse 3.4M5 (I20080207-1530)
Comment 1 Dani Megert CLA 2008-03-12 07:57:44 EDT
If you have this: "new Te' Ctrl+Space" you should already get the constructor being added (this is bug 6930). More general, this is a dup of bug 25313.

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