Bug 19930 - Refactor->Extract Local Variable should guess name [refactoring]
Summary: Refactor->Extract Local Variable should guess name [refactoring]
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 2.1   Edit
Assignee: Adam Kiezun CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2002-06-11 14:33 EDT by Peter Burka CLA
Modified: 2002-07-26 09:33 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Burka CLA 2002-06-11 14:33:08 EDT
Build F2

90% of the time, when I extract a local variable, the variable name could be 
easily inferred from selected code.

If the last message send in selected code is of the form 'getXXX', the 
variable name should probably be XXX.

e.g. I just extracted a local variable from the following code:
  getEditorPart().getToolTipHandler()
not surprisingly, I named the variable toolTipHandler.

It would be nice if the action figured this out for itself and seeded the 
variable name text field with this guess.
Comment 1 Adam Kiezun CLA 2002-06-11 14:37:28 EDT
i like this idea
will have a look after the 2.0 swirl is over
Comment 2 Adam Kiezun CLA 2002-07-26 05:31:51 EDT
re-o
Comment 3 Adam Kiezun CLA 2002-07-26 09:33:23 EDT
fixed - guesses names if last message send's name starts with 
'get' or 'is' and if the next char is upper case
so:
getFred() -> fred
isSmall() -> small