Magik Editor Template Variables

Template variables may be used in the template patterns. Variables are resolved to their specific value when the template is evaluated in its context. Variables may be specified using following syntax:

${date}

This defines a variable with name 'date' that will resolve to current date. It can be referenced multiple times as is. If there are several possible matches for a variable, they are presented as proposals.

General Template Variables

Magik context define the following variables:

Variable Description Type
${class} Evaluates to the name of current exemplar. Code
${class_list} Evaluates to the list of all exemplars names specified in a file. Code
${classify_level_list} Evaluates to the list of all classify levels specified in a file. Pragma
${cursor} Specifies the cursor position when you close the template edit mode. This is useful when we want the cursor to jump to different place than to the end of the template upon leaving the template edit mode. Other
${date} Evaluates to the current date. Other
${dollar} Evaluates to the dollar symbol '$'. Alternatively, two dollar symbols can be used: '$$'. Other
${file_name} Evaluates to a file name of a current source file. Other
${line_selection} Evaluates to content of all currently selected lines. Other
${package} Evaluates to the name of the closest package. Code
${previous_topics} Evaluates to the list of topics of the previous pragma. Pragma
${slot_access_flags} Evaluates to the list of all possible flags for creating slot access methods. Code
${slot_access_flavours} Evaluates to the list of all possible flavours for creating slot access methods. Code
${slot_list} Evaluates to the list of all slots specified in a file. Code
${time} Evaluates to the current time. Other
${topic_list} Evaluates to the list of all topics specified in a file. Pragma
${usage_list} Evaluates to the list of all usages specified in a file. Pragma
${user} Evaluates to the user name. Other
${word_selection} Evaluates to the content of the current text selection. Other
${year} Evaluates to the current year. Other

Related concepts

Templates

Related reference

Templates preferences
Magik content assist
Code templates preferences
Code style preferences