Previous Topic

Book Contents

Book Index

Next Topic

Code Completion

Code completion is an advanced feature of the script editor which makes coding much faster and eliminates the chance of misspells.

If you press <Ctrl+space>, you'll see a popup with items beginning with the letters to the left of the cursor. If there is exactly one item starting with the typed letters, the popup will not appear and the item will be inserted immediately into the script.

Possible items can be:

  • Functions

    All the functions defined in the script – (def func():) (pink icon).

  • Local variables

    All variables defined in the current method up to the cursor (blue icon).

  • Global variables

    All variables defined in the main part of the script (up to the cursor if we are in the main part) (gray icon).

  • Input variables

    All variables coming from other nodes in the workflow (gray icon).

  • Implicit variables

    Transaction, VM, _input, _output (gray icon).

  • Templates

    User defined templates to speed typing of frequently used constructs (yellow icon).

  • Methods

    After a dot: all public methods of the target class of variable/method/function/class to the left of the dot (green icon).

Type more letters to narrow down the list or scroll down/up and then press Enter to insert the selected item into the text. Press Esc to hide the list.

Example:

Let's say you want to type the existing variable 'reqTransaction'. You want to type it fast or you may not know exactly the whole name but you know it starts with 'req'.

  • If you just press <Ctrl+space>, you'll see the following list which contains all possible items:

    Help Image

    The list contains many items because there is a great number of available functions and variables in this example script. Now you would have to scroll down, find the variable and then press Enter.

  • If you type 'req' and press <Ctrl+space>, you'll see only items beginning with 'req' (here 3 variables and 2 input variables):

    Help Image

    You could now press Enter to insert to complete the code. But

  • if you continue typing and type 'T', only one item starts with 'reqT' so the popup will contain only:

    Help Image

    Now press Enter, the popup will disappear and the text will be completed with 'reqTransaction'.

If you type 'reqT' and press <Ctrl+space>, the popup will not appear and the text will be completed to 'reqTransaction' immediately (because there is exactly one item starting with 'reqT').

In This Chapter

Completion of Methods

Specifying Target Class Explicitly

See Also

Script Editor

Using the Script Editor

Script Editor Window

Search in the Script Editor

Templates

Python Script and Diacritics