Bug 92322 - [refactoring] refactoring without modal window
Summary: [refactoring] refactoring without modal window
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 171205
Blocks:
  Show dependency tree
 
Reported: 2005-04-21 22:26 EDT by Andrew Freeman CLA
Modified: 2008-05-02 10:42 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Freeman CLA 2005-04-21 22:26:25 EDT
Microsoft Refactor! for Visual Basic 2005 Beta 2 provides refactoring without 
the overhead of a modal popup window.  You really have to see the demos to 
appreciate the developer productivity enhancements these will provide.  All I 
can say is seeing is believing...


Overview of tool:
http://msdn.microsoft.com/vbasic/downloads/2005/tools/refactor/

Short videos that demo this functionality:
http://msdn.microsoft.com/VBasic/Downloads/2005/Tools/Refactor/30SecDemo.Aspx
http://msdn.microsoft.com/VBasic/Downloads/2005/Tools/Refactor/3MinDemo.Aspx

=====================================
- Clicking a variable in the text editor presents a refactoring dropdown icon, 
the Microsoft Smart Tag, that allows the variable to be renamed or moved near 
its first reference.

- Clicking on the refactoring dropdown icon lists the possible refactorings 
and a short description about what the refactoring does to the code.

- Block highlighted code presents a refactoring dropdown icon that lists 
possible refactorings when clicked.  This icon saves the developer from having 
to right click the block and select the refactoring menu.

- The Extract Method refactoring automatically attempts to give the method a 
name based on comments that come before the highlighted block.  If the code 
comment was "Do a big job" the method would automatically be named doBigJob. A 
large visual indicator is presented to show where the method is to be 
inserted.  A popup menu presents keyboard shortcuts that can be used to 
control the position of the visual indicator.  The up arrow will move the 
indicator above the previous method, the down arrow will move the indicator 
below the current method, the enter key accepts the location, and the escape 
key cancels the refactoring.  The default method name is now highlighted so 
that it can be renamed.  

- Extract Constant, Extract Local, Extract Field refactorings behaves similar 
to the Extract Method refactoring.

- Clicking on a method name, variable, or parameter highlights the text 
similar to the mark occurances does today and puts into automatic rename 
refactoring without a modal window.

- Reorder Parameters refactoring requires clicking on the refactoring dropdown 
icon.  This refactoring behaves similar to the Extract Method refactoring in 
that a menu appears showing the keys that can be used during the refactoring.  
This time the left arrow moves the parameter left, the right arrow moves the 
parameter right, the tab selects the next parameter, the shift-tabe selects 
the previous parameter, the enter commits the changes, and the escape cancels 
the refactoring.  The parameters are visually rearranged.

- Cutting and pasting via the clipboard performs an automatic Extract Method 
refactoring.

=====================================

Supported Refactorings without modal windows:
Reorder Parameters 
Extract Method 
Extract Property 
Create Overload 
Surrounds With 
Encapsulate field 
Reverse Conditional 
Simplify expression 
Introduce Local 
Introduce constant 
Inline Temp 
Replace Temp with Query 
Split Temporary Variable 
Move initialization to declaration 
Split initialization from declaration 
Move declaration near reference
Comment 1 Andrew Freeman CLA 2005-10-18 00:28:59 EDT
Is this what is being planned for 3.2M3?

"Investigate in more light-weight user interface for certain refactorings. For
example rename could be executed in place inside the Java editor (Markus)."
Comment 2 Dirk Baeumer CLA 2005-10-18 04:23:38 EDT
Yes, but its investigation and we haven't decided yet if we provide any support
for 3.2 since it will be major work. Our first focus will be rename and
refactorings local to one CU.
Comment 3 Martin Aeschlimann CLA 2006-06-16 16:39:00 EDT
we're looking at this again in 3.3
Comment 4 Benno Baumgartner CLA 2006-07-07 05:00:08 EDT
For a start I would be happy to just have 'Inline' and 'Extract Method' available in the quick assist pop up, like it is already the case for 'Extract Local'. 
Comment 5 Alex Blewitt CLA 2006-08-15 05:05:34 EDT
It seems that there are a number of things that could be done with mouse gestures that aren't currently done.

For example:

o Use the scroll wheel (with some text selected) to expand/contract the current selection (using the current expand selection action)
o Drag selected text (probably with some modifier pressed like Alt to indicate a refactoring operation) to extract local variable or method (depending on where it is dragged to; if it's dragged inside a method, then make it a local variable; if it's dragged outside a method then make it a method)
o Drag-with-link; just as you can create symlinks in Mac (or shortcuts on windows with Ctrl+Shift); if you drag a method to another class, it creates a delegate to that class (possibly also creating an instance field on the fly if no suitable one exists)
o Drag class-to-other-class; if you drag one class on top of another, it creates an instance field to that class, or creates a sub/super-class relationship (possibly modifiers for the same)
o Drag class-to-new-class; either a 'drop' location (e.g. the 'new class' button) to create a new superclass
o Reordering of method parameters by dragging them into a different location using the above
o Drag'n'shake; shake a local variable to the left to send it to a instance field (similarly to the right to demote an instance field)
o Drag'n'shake; shake methods upwards to promote, downwards to demote

There may also be other in-line improvements ala the demo

o Use in-line rename (e.g. press F2 and the cursor refactor-renames whatever it's sitting in e.g. method, argument). I like that the demo shows changes in the current view as it's happening, though a confirmation of changes if they're outside the local file makes sense. Not sure it would work on Mac, where the rename is often 'Enter' :-)
o Refactorings in quick-fix menu?

PS Can this bug be updated against 3.3? It currently shows 3.1
Comment 6 Martin Aeschlimann CLA 2006-08-21 14:47:30 EDT
Alex, can we keep this bug just for 'refactoring without modal window'? These are good ideas, but we can't do all in one bug report.


Comment 7 Martin Aeschlimann CLA 2006-09-20 12:15:34 EDT
For M2 we released a first proptotype of rename that doesn't show a dialog.
Comment 8 Andrew Freeman CLA 2006-12-29 08:04:19 EST
Updated link to video:  

http://www.devexpress.com/Products/NET/IDETools/Refactor/

Click the "See Refactor! in Action" link on the left which takes you to

http://msdn.microsoft.com/VBasic/Downloads/Tools/Refactor/3MinDemo.Aspx
Comment 9 Markus Keller CLA 2007-02-05 14:38:13 EST
Rename support has been released as default for 3.3 M5. A few other refactorings have been added as quick assists as well.

Setting target milestone to 3.3 to decide if and what more we want to do for 3.3.
Comment 10 Martin Aeschlimann CLA 2007-05-24 09:38:29 EDT
Will investigate more in 3.4
Comment 11 Martin Aeschlimann CLA 2008-05-02 10:42:52 EDT
Nothing more planed for 3.4.