8

How do I undo the removal of a method in Squeak Smalltalk?

Edward Ocampo-Gooding
  • 2,782
  • 1
  • 23
  • 29

3 Answers3

10
  1. 'World Menu'->'open'->'simple change sorter'
  2. In the top-right pane, select the class from which the method was removed.
  3. In the middle pane, select the removed method.
  4. Right click on the method name, bringing up a menu
  5. Select "versions"
  6. When the versions tool comes up, select the top (most recent) version, which is the one you deleted.
  7. Click the "revert" button

When you browse your class, you will see that the method is restored.

Sean DeNigris
  • 6,306
  • 1
  • 31
  • 37
4

If you use OmniBrowser and the Refactoring Tools you have unlimited undo/redo on all your code changes like in any other modern editor. Select in the context menu Refactor > Undo.

Lukas Renggli
  • 8,754
  • 23
  • 46
  • Thanks Lukas! After I finish [this epic tutorial](http://squeak.preeminent.org/tut2007/html/035C.html) I’ll learn how to install packages in Squeak and will give OmniBrowser a shot. – Edward Ocampo-Gooding Jun 25 '12 at 13:42
4

You can open your changes file:

  • Tools menu at the top of your screen.
  • File List (which should open in the right place).
  • In the upper right pane select the changes file (given an image called Foo.image, you'd look for Foo.changed).
  • Hit the "recent changes" button, browsing as far back as the latest (top) snapshot.
  • All method additions, alterations, deletions, DoIts are listed in the list that pops up.
  • Select the method/s you want, right click (I can never remember the colours for mouse buttons) and "fileIn selections".
Frank Shearar
  • 17,012
  • 8
  • 67
  • 94