Code Completion

Code completion comes in a number of flavours. One way is syntax expansion. Another way is recognizing code symbols (such as procedure and variable names). A third is to match strings in the current file.

Syntax expansion is like providing a template and you fill in the blanks. For example, while coding Perl, if you type if, the editor will recognize if as a keyword and then expand it to if (){ } to suit your favourite brace style.

The second way is by understanding the program code. By recognizing the procedure names as you key them in, the editor can supply parameter information and prompt for parameter values. This is a real boon. But, the real kicker is when it starts recognizing procedure names from other project files or even standard code libraries.

The third category of code completion, works with arbitrary strings. Instead of retyping long strings, you type the first few characters and then get the editor to look for a matching string. Sort of like an incremental search. Except that you have the option of using the string that is found.

For example in Visual Slickedit, as you key in some text, you hit ctrl-shift-< and the editor will search backwards in the file to find the first matching text. If this is not the text you are looking for, hit ctrl-shift-< again to find the next match. Once you have found the right piece of text, you can either hit enter to use it or you can pick up more of the surrounding text by pressing ctrl-spacebar.

All three of these techniques are provided by Visual Slickedit and VIM.