Bug 126807 - [refactoring] inplace rename refactoring
Summary: [refactoring] inplace rename refactoring
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2006-02-07 16:15 EST by Chris Gross CLA
Modified: 2009-08-30 02:06 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 Chris Gross CLA 2006-02-07 16:15:19 EST
I would like to be able to rename a variable without having to open a dialog.  It could work somewhat like:

- I highlight a variable
- hit command key (alt-shift-z - whatever key binding)
- I type in new variable name, overwriting old name (A tooltip could be displayed showing whether the current name is a valid value, i.e. does not conflict with an existing variable name)
- then I hit space/enter/semicolon/click away to end the rename
- if the new value is a valid name then the references would be updated and I could continue typing
- if the value was not valid, the old name would reappear and the refactoring is essentially cancelled.

I've been told this is a feature coming in a new version of IDEA.  I'm not sure how it is (or will be) implemented in IDEA, but the above workflow seemed intuitive.
Comment 1 Frederic Fusier CLA 2006-02-08 01:53:58 EST
Move to JDT/UI
Comment 2 Martin Aeschlimann CLA 2006-02-09 03:33:34 EST
What we have is 'rename in file' that works like that.
Ctrl + 1, Rename in file. (Shortcut Ctrl + 2 + R)

As the name says, this only modifies references in your file; it's a code manipulation utility, not a refactoring. 

But yes, we are also looking at ways of providing more light weigth refactoring dialogs.
Comment 3 Orestis Markou CLA 2006-05-28 11:43:45 EDT
JBuilder has a great think like rename in file, but can be assigned to selections instead. Example:

Label l1 = new Label(parent, SWT.NONE);
l1.setTest("Hello World");
l1.setFont(font);
l1.setColor(RED);

Suppose you have to create 3 more labels with the same characteristics. In JBuilder you can copy paste the above three times. Then, select each of the 3 additional snippets, press a button, and then you can replace "l1" with "l2" in one place and it will replace the rest too. It doesn't look for java-specific stuff. Any common variable names are selected, strings are left untouched. Pretty cool.

Currently in eclipse this has to be done manually, or using a search-replace thing, prone to errors.
Comment 4 Martin Aeschlimann CLA 2006-05-29 16:05:52 EDT
I'm not sure how the selection happens. Can you attach a screenshot?
Comment 5 Martin Aeschlimann CLA 2006-06-11 07:09:54 EDT
setting to remind until we get more information
Comment 6 Denis Roy CLA 2009-08-30 02:06:18 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.