Version 3 (modified by manualwiki, 13 years ago) (diff) |
---|
Undo
RefactorErl? had an undo operation for refactorings, but with this method could you lose some modifications. Namely if the you edit the text after a refactoring, then undo the changes, all changes since the last refactoring were lost. This undo was one step only, but it could be extended to more steps. However, if we extend this undo, at refactoring undo there can arise conflicts among changes of editing and the transformations - and also among two transformations -, but refactoring undo should handle these conflicts, and it must be as complete as possible. In this section we introduce a new undo/redo mechanism for the tool integrated in Emacs.
Installation
The new undo mechanism is disabled by default, to enable it, we need additional software components. This extended undo is implemented by a stand alone Haskell program, so we need ghci Haskell Compiler and cabal packaging system, that makes easier the installation of the required packages, modules. The Haskell compiler can be downloaded from the website http://www.haskell.org/ghc/download. Cabal is available at http://www.haskell.org/cabal/download.html or on Linux systems with cabal-install package. The files of this component can be found in lib/referl_ui directory within the tool under emacs. In this directory you have to run make for compiling the source. To enable the new undo mode you had to set the refactorerl-undo-mode to selective-undo.
Usage
The undo (redo) function is available in the Refactor menu with Undo (Redo) menu item. Calling the undo operation the program undoes the last change in the current file. Case refactoring the modifications will be rejected in every affected file, but in some cases can conflits arise. When you edit an affected file, or make one another refactoring, the system checks, if the second change affects the refactored area in the file. If the changes are overlapped, the undo reverts also this change, otherwise only the first one, and you get a merged state of the file. At more complex changes can also more changes get reversed. In both cases the changes can be redone until a newer modification.
Attachments (3)
-
sel-undo.png
(89.9 KB) -
added by manualwiki 13 years ago.
selective undo menu
-
ex-1-merge.png
(166.2 KB) -
added by manualwiki 13 years ago.
Example 1 - Merge
-
ex-2-confl.png
(179.2 KB) -
added by manualwiki 13 years ago.
Example 2 - Conflict
Download all attachments as: .zip