Community
Participate
Working Groups
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
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)."
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.
we're looking at this again in 3.3
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'.
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
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.
For M2 we released a first proptotype of rename that doesn't show a dialog.
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
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.
Will investigate more in 3.4
Nothing more planed for 3.4.