Pintside Thoughts
Dolphin Enhancements

After many years of programming in Java and C#, I decided to revisit Smalltalk after hearing about the new Dolphin Smalltalk X6 (with its cool features like tabbed browsing and code completion). I've been very impressed, having a modern IDE (especially when you are used to Eclipse or IntelliJ) makes doing the right things just that little bit easier.

As I wrote to Object Arts -
There is a lot of renewed interest in dynamic languages, from their ease at expressing domain specific problems, to their immediacy in developing working solutions... this latest version of Dolphin absolutely blows your socks off! ... its many other features like refactoring tools, code mentor and built in unit testing, make this environment not only highly productive but also fun to use. Intelli-J, Visual Studio and Eclipse - look out - Smalltalk is back!

And while the environment is awesome - there are always small enhancment that you spot, and the best thing is that in Dolphin (i.e. Smalltalk) they are pretty easy to figure out and create. Having access to the source code, and the code parser makes writing tools pretty trivial, and lots of fun.

The following are Dolphin Environment Enhancements:

  1. Intelli-Dolphin
  2. SmallCruise


Intelli-Dolphin

My small improvements many inspired by the dynamism of Eclipse and IntelliJ were each enjoyably created on my train ride to work, and consist of the following:

  1. "Intelli-Brackets"Picture showing intelli-brackets
    I often type an expression in a Smalltalk method, thinking about  how the objects are sending messages to each other only to discover that I am missing out important brackets in what I've just typed. e.g. After typing: "a > 0 and: [ a < 10 ]" I suddenly realise that typing "ifTrue: []" won't work becuse the previous expression needs brackets. This patch allows you to type Ctrl-0 or Ctrl-] to surround the previous expression with brackets. If it doesn't surround a wide enough area - press it again and it will expand its range (similar to how Ctrl-U) works. Used in conjuction with Ctrl-U or simply hiliting ranges of text, you can also conveniently surround selected ranges with brackets as well.
  2. "Intelli-Tab"Picture showing tab to error behavior (improved in 1.2)
    After using auto-complete to select a mutli keyword method, entering each of the keyword parameters requires extra keyboard or mouse usage. This extension allows the tab key to easily jump to the next compiler error or incomplete code block (unless you are at the beginning of a line, next to a tab, or have a muliple selection). You can see this in the Intelli-Dolphin Completion in action demo. Improved in 1.2 so that Chift-Tab will jump to the previous error or incomplete code block.
  3. "Define All Temps" / Improved Auto-Correct*Picture shwowing define all menu item
    Building on auto-corect define temporary, this extension allows you to correct all undefined temps in one go. Perfect when using TDD, you think about your test and which objects you need, at the end you can define all the temps. Furthermore auto-correct has been improved so that it will allow correction not only if the cursor is before an item, but also at the end, or selected. The latter is particularly handy when you save and Dolphin automatically hilites the first code error for you. 
  4. Ctrl-Enter Define Temp* (improved in 1.2)
    When your cursor is after an undefined item (i.e. you have just entered it) - pressing Ctrl-Enter will automatically define it for you, saving you the time of using the auto-correct context menu. Improved in 1.2 to correct the first undefined item before the cursor. 
  5. Keyboard Fwd/Back History*
    While Alt-Left/Right change your current tab to the next one in sequence, if you are running Unit Tests, or using the Method Explorer, the last tab is often not sequentially to the left or right. Alt-Up/Down will mave you backwords (or forwards) in the recorded navigation history.
  6.  "Intelli-Comment" the current line or selection.Picture showing comment completion
    If you want to comment out some code, Ctrl-U will hilight an area for you, but putting comments around that area is not there. Ctrl-2 (") is configured to do this. Additionaly if you don't select anything, it will comment the current line - a great time saver if you are trying out ideas.
  7. Copy current line.
    There is a keystroke for copying the current line - but I can never remember it. Ctrl-C is much easier to remember, so this patch adjusts copy enablement to allow you to copy the current line if nothing is selected.
  8. Copy Class in the Class menu.Picture Of Copy Class Dialog
    While you can do it by drag and drop, that doesn't seem to quite work how you expect. This implementation gives a you clear dialog to enter a new name, select a superclass and (usefully) a package. You don't use it all the time, but to copy a strategy or visitor object this really helps. Of course once you get it working, use the excellent refactoring tools to remove the duplication.
  9. Show inherited methods checkbox.Picture showing inherited checkbox
    Some of the Collection classes have lots of inherited methods - I hate scrolling up and down, and the right-click menu option in the environment is a bit time consuming and awkward. This adds a quick way to view the inheritance in both the Class and System browsers - and provides a conveniant keyboard shortcut as well.
  10. "Intelli-TDD Key"
    I run my unit tests frequently, so having a quick way to run my tests, verify the results, and then flip back to coding is extremely useful. This enhancement adds Ctrl-1 (for test first) as a keyboard binding to the Class, System, Method and Package browsers so that you can run the current unit test (the selected class, or if a test is not selected, the last unit test) in an SUnitBrowser.  When in the SUnitBrowser, pressing Ctrl-1 again, will take you back to the last window. Additionaly, Ctrl-Shift-1 will run all the tests in the package of the current unit test (or the last unit test).
  11. "Intelli-SUnit Errors"Picture showing SUnit error selection
  12. When you run unit tests, if one of them fails, the enhancements automatically selects the first failing tests and displays its error message in the status bar of the SUnit browser, instead of just showing the count of failing tests.


    Picture showing SUnit status bar


    With this enhancement is a new type of TestCase, the ErrorReportingTestCase which improves the SUnit #should:raise: method with one that indicates the exception that was raised and the excpetions that was expceted.

    Note: This enhancement patches SUnit so that it stores any exceptions in the TestResult so that it can be retrieved.

You can see many of these improvements in action in the small Flash demo, Mock Objects and TDD in action.

* These items require Dolphin Professional


Dolphin Improvements Download

The latest version is available as: Intelli-Dolphin-1.2.zip

Contents:

Dolphin Improvements.pac The main improvements as listed above.
Dolphin Professional Improvements.pac The version to load if you have the professional edition (it loads the standard improvments as a prerequisite)
SUnitBrowser  Improvements.pac Improvements to the SUnitBrowser.

Warning: this package patches SUnit. While this has been tested in several images, ensure you have a backup of your image (or try this in a clean image)
Environment Patching.pac  Prerequisite - The basic library for patching methods in the image

Items in bold are main packages that should be loaded into Dolphin (the others are prerequisites).

Known Problems in V1.0/1.1

  1. The "Show Inherited Methods" checkbox can appear as a black box. This is due to how Dolphin renders a checkbox on a gray gradiant with some XP Desktop Themes. The workaround is to adjust your theme to use the "Windows classic style" for Windows and Buttons in the Appearance tab of Display properties or execute: IntelliDolphin unadjustDefaultViews (which will restore the old view without the inheritence checkbox). Or more permanently edit IntelliDolphin>>#initialize and comment out: patchBrowsersForShowInherited.
  2. If you type very quickly, its possible that Tab will incorrectly navigate to the next error - it will hilite where it thinks the last error was (which may be out by several characters) as it has been unable to calculate the new error location. This is normally rare, and pressing Tab a second time will correct it.

Small Cruise

The following is a sneak preview of SmallCruise, integration between Dolphin Smalltalk and CruiseControl.net that provides Continuous Integration of your Smalltalk projects. Watch SmallCruise In Action.