Community
Participate
Working Groups
Besides the default constructor that is offered as a completion option when you invoke the completion insdie a class and outside of a any method, it'd be very usefull if also a construct was shown that sets the existing fields in the class.
There's a quick assist for that, right Martin?
There is also a dialog accessible from the Source menu that generates a constructor from the fields, but it would be convenient to just have it in the completion. If I'm not mistaken the quick fix "Assign parameter to field" does it the other way around. If you don't have the fields yet and after you've written the constructor you can move the cursor on parameters of the constructor and generate the setting code and the fields necessary.
Having this in content assist makes sense too (as a second proposal). Dani, I know I implemented that proposal once, but I think it should better be in the jdt-text inbox.
>Dani, I know I implemented that proposal once So, it's there already?
The 'create constructor' proposal is there already. But just for default constructors. The suggestion would be to add a second one with a parameter per field.
*** This bug has been marked as a duplicate of bug 202470 ***
Wanted to mark as dependent - not dup.
Not for 3.4.