Content assist in the ST-editor

A very instrumental function to quickly enter ST-code is Content Assist:

  1. Position within the ST-code where you need the appropriate ST-code.

  2. Start content assist: context menu within ST-editor, Source, Content Assist
    Keyboard shortcut: Press Ctrl+Space.
    Result: You see a list with all elements that are possible within the current context of the ST-code.

  3. Do one of the following:

    • Enter one or more letters. This displays a list with all elements fitting your input.
      Example 1: Enter the beginning of a →keyword; such as: PRO – A keyword is prefixed by icon images/download/thumbnails/409863566/ContAssKeyword-version-1-modificationdate-1531299242397-api-v2.png in the list.
      Example 2: Enter the beginning of a →template; such as: fun – A template is prefixed by icon images/download/thumbnails/409863561/ContAssTemplate-version-1-modificationdate-1531299219436-api-v2.png in the list.
      For details on a template: Click on a template or select it with the cursor movement keys ↑ (Up) or ↓ (Down) in order to see the code for the template to the left of the list.

    • Click an element in the list or select it (by using the mouse or the cursor movement keys) and press the Enter-key .
      Result: The keyword or the code of the template is inserted at the current position. If the template contains one or more template variables, the first template variable is selected.

      What is a template variable?

      A template variable marks an editable location in the code of the template. They can be resolves to a concrete value when the code of the template is evaluated in its context. They can also provide a list of alternative proposals valid at the given location.
      For instance, a template variable within a declaration template stands in for the identifier that is needed within a declaration.

    • Press the ESC-key to close the list and exit content assist.

  4. If the inserted code contains template variables, overwrite these template variables as follows

    1. As the first template variable is already selected, just type the requested identifier. (If the same template variable is repeatedly used in the code, the identifier is automatically entered at all of these places.)

    2. Press the Tab-key to select the next template variable. Overwrite it as well.

    3. Press the Tab-key until there are no template variables left to overwrite. Then you leave the code of the template.

logi.cals has provided many templates for you to use. You can view them in the preferences: menu Window, Preferences, group ST-Object, Templates
There, you may also create your own templates or edit the existing ones.