View on GitHub

RED - Robot Editor

Eclipse based editor for RobotFramework testcases

RED - Robot Editor User Guide > User guide > Working with RED >

Code templates

Templates can be used to define source code patterns that are often repeated. They are inserted by content assist (CTRL+SPACE).

There are some templates already defined in RED. User custom templates can be also defined in Window -> Preferences -> Robot Framework -> Editor -> Templates.

Template context description

Contexts mean places in document where given template makes sense and can be inserted.

There are following contexts defined in RED:

Automatic proposal insertion

When there is only one proposal matching user content and automatic insertion is enabled, code assistant will choose and insert it automatically.

To enable such behavior new preference "Insert single proposals automatically" was added to Window -> Preferences -> Robot Framework -> Editor -> Content Assist.
This preference has to be enabled first, then "Automatically insert" option from templates will work as described.

Variables in templates

Template patterns can contain custom user variables. When template is inserted user can define values for such variables.

There are also several Eclipse predefined variables, which can be inserted with "Insert variables" button or by content assist in pattern editor. Such variables are resolved to concrete values when the template is inserted.

Following example contains predefined Eclipse variable for dollar sign escape together with two user variables:

$${${name}}=    Set Variable    ${value}