Bug 22981 - code completion should suggest getter/setter method names
Summary: code completion should suggest getter/setter method names
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-29 10:34 EDT by Lev Epshteyn CLA
Modified: 2007-06-29 04:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lev Epshteyn CLA 2002-08-29 10:34:19 EDT
If I start typing in a new method declaration, and press Ctrl-Space mid way, JDT can 
*INTELLIGENTLY* suggest some things that it does not currently do.

For example, if I have a 
"protected int length;" data member, and I type in
"public int get" and press Ctrl-Space, it 
should suggest a getter method for length (as well as all other int members for which one does not 
already exist). 

Actually, it would also be nice if the body of the method was generated as well 
if it's a getter/setter (I know this can be done with templates, but it's a bit less counter-
intuitive).

Among other suggestions it should probably offer is matching non-final method 
form the superclass that you can override, etc.
Comment 1 Erich Gamma CLA 2002-08-29 11:46:27 EDT
Code assist already offers proposals for methods that can be overridden. Try:
public class Bar {
 <code assist>	
}

I like the proposal for method name completions for getters/setters. This would 
have to work for the different instance variable prefix conventions (fLength, 
m_length etc.).

Moving to JDT Core for comment.
Comment 2 Philipe Mulet CLA 2002-09-02 12:08:08 EDT
For getter/setter, we should offer field completions on method declarations as 
well, so that UI could jump in and insert a getter/setter method ?
Comment 3 Philipe Mulet CLA 2002-10-08 07:25:11 EDT
Unsure we want to follow this path.
Comment 4 Philipe Mulet CLA 2003-01-22 17:00:40 EST
Defer
Comment 5 David Audel CLA 2007-06-29 04:50:29 EDT
Reopen
Comment 6 David Audel CLA 2007-06-29 04:51:34 EDT
This feature exists in 3.3. Fixed in a previous build.