Tutorial: Turbo Completion Mode

Index of All Documentation » Wing Tutorial »

Auto-completion normally requires pressing a completion key, as configured in the Editor > Auto-Completion > Completion Keys preference, before a completion is entered into the editor.

Wing also has an experimental Turbo auto-completion mode for Python where completion can occur on any key that cannot be part of a symbol. This can greatly reduce typing required for coding but it takes some effort to learn to use this feature.

Try it now by enabling the Python Turbo Mode preference. Then go to the bottom of example1.py and press the following keys in order: R ( G e t (. You will see the following code in the editor produced by these six key strokes:


Depending on your Python version you may not need as many keystrokes before GetItemCount is selected in the completer. As soon as it is, the final ( may be pressed.

Turbo completion mode distinguishes between contexts where a new symbol may be defined and those where an existing symbol must be used. For example try typing the following keystrokes on a new line: c, =. Wing knows that the = indicates you are defining a new symbol so it does not place the current selection from the auto-completer.

In a context where you are trying to type something other than what is in the completer, pressing Ctrl briefly by itself will hide the auto-completer and thus disable turbo-completion until you type more symbol characters and the completer is shown again.

This mode is still considered experimental because it doesn't always do the right thing, but on the whole enabling Python Turbo Mode cuts back considerably on unnecessary typing.