Tab Completion returns to Squeak

7 October, 2010

Levente Uzonyi is obviously one of a number of people who have been quite envious of the built-in tab-completion in Pharo, so he’s put in the work required to make OCompletion work on Squeak images again. OCompletion works in two ways: it offers a short list of automatic completion hints as you type based on your recent activity, or you can bring up the fuller (classic eCompletion) list by using the tab key, and use the up and down arrow keys to navigate the list and the right arrow to reveal syntax-highlighted source code for the methods listed.

OCompletion is a re-working of the venerable eCompletion package, based on research done by Romain Robbes and Michele Lanza. It is aware of the current context as you type, and so offers suggestions from your current area of work e.g. class, package etc. This means that it responds much more quickly than eCompletion based on the complete image code base. It also adds a number of look-and-feel enhancements that make it a perfect fit with the current appearance of Squeak.

To try it out, just evaluate the following script in your image:

Installer squeaksource
 project: 'RoelTyper';
 install: 'RoelTyper-FredericPluquet.82';
 project: 'OCompletion';
 install: 'OcompletionSqueakCompatibility-ul.1';
 install: 'Ocompletion-ul.67'.

Useful notes:

  • Check out the squeaksource page for OCompletion to review latest versions of Levente’s code
  • Default behaviour is to switch on the ecompletionSmartCharacters preference, which results in auto-typing of matching [], (), {}, “”, ” characters. Some people may wish to switch off this preference.

Thanks to Levente for making this handy tool available in Squeak again!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: