Quantcast
Channel: Wing Tips
Viewing all articles
Browse latest Browse all 80

Turbo Completion Mode in Wing Pro

$
0
0

In this issue of Wing Tips we look at how to use Wing Pro's turbo completion mode for Python. Auto-completion normally requires pressing a completion key, as configured by the Editor>Auto-completion>CompletionKeys preference, before a completion is entered into the editor.

Wing Pro also provides a PythonTurboMode for auto-completion, where completion occurs on any key that cannot be part of a symbol. This allows you to type just enough of a symbol until it is selected in the completer, then move right on to typing the code that follows that symbol. It takes some getting used to, but it can greatly reduce typing once you become comfortable with it.

The following example shows the code that can be produced simply by typing the characters p=x.p.e.P( without pressing any completion keys:

/images/blog/turbo-completion/turbo-completion.gif

This particular case requires only a single character to match each symbol in the auto-completer. In a more cluttered name space, it may take more characters to match the desired symbol, but in many cases two or three characters is all that is needed before you can move on to the next part of the expression you are trying to type.

Notice that turbo mode distinguishes between contexts where a new symbol may be defined and those where an existing symbol must be used. For example, if you type c followed by = on a new line, Wing knows that the = indicates you may be defining a new symbol and does not place the current selection from the auto-completer. When you do want completion to occur in a defining context, you can press Tab or another completion key.

In a context where you are trying to type something other than what is in the completer, you can press Ctrl, Alt or Command briefly by itself to hide the auto-completer and thus disable turbo-completion until you type more symbol characters and the completer is displayed once again.

Turbo completion is enabled with the Editor>Auto-completion>PythonTurboMode preference in Wing Pro.



That's it for now! We'll be back next week with more Wing Tips for Wing Python IDE.


Viewing all articles
Browse latest Browse all 80

Latest Images

Trending Articles





Latest Images