Table of content
WholeTomato

VA Snippet Reserved Strings

VA Snippets can include reserved strings that expand when a VA Snippet is invoked. A reserved string obtains it value from an IDE setting, project property, system setting, or surrounding code.

Reserved strings are case sensitive and must be enclosed in dollar signs.

Reserved strings are grouped by type, and can be inserted in the VA Snippet editor via context menu, toolbar button, or keyboard shortcut (Ctrl+I).

Case Variants

Many reserved strings have variants that expand to specific cases. The variants follow the names of the non-cased reserved strings. For example, the uppercase variant of $FILE_BASE$ is $FILE_BASE_UPPER$.

Variants include UPPER, LOWER, CAMEL, and PASCAL.

CAMEL and PASCAL variants affect more than the initial character of an expanded value only when Visual Assist can distinguish words within the expanded value.

For example, the PASCAL variant affects pieces of file path.

The case variants behave differently when used with reserved strings compared to use with VA Snippet Input Placeholders.

Date

Reserved strings expand to the system date, or portions thereof, in various formats. 

Reserved String Meaning Case Variants
$DATE$ Year/month/day formatted as "yyyy/MM/dd"  
$DATE_LOCALE$ Current date in locale format Yes
$DAY$ Day of month as number (without leading zero)  
$DAY_02$ Day of month formatted as "dd"  
$DAYNAME$ Day abbreviation in locale format Yes
$DAYNAME_EN$ Day abbreviation in English Yes
$DAYLONGNAME$ Full name of day in locale format Yes
$DAYLONGNAME_EN$ Full name of day in English Yes
$MONTH$ Month as number (without leading zero)  
$MONTH_02$ Month formatted as "MM"  
$MONTHNAME$ Month abbreviation in locale format Yes
$MONTHNAME_EN$ Month abbreviation in English Yes
$MONTHLONGNAME$ Full name of month in locale format Yes
$MONTHLONGNAME_EN$ Full name of month in English Yes
$YEAR$ Year as number  
$YEAR_02$ Year formatted as "yy"  

Time

Reserved strings expand to the system time, or portions thereof, in various formats.

Reserved String Meaning
$HOUR$ Hour as number (without leading zero)
$HOUR_02$ Hour formatted as "HH"
$MINUTE$ Minute formatted as "mm"
$SECOND$ Second formatted as "ss"

File

Reserved strings expand to properties of the active document in the text editor, in original case or in uppercase.

Reserved String Meaning Case Variants
$FILE$ Full filename with path Yes
$FILE_BASE$ Filename without path or extension Yes
$FILE_EXT$ Filename extension Yes
$FILE_PATH$ Path of file Yes

Project/Solution

Reserved String Meaning Case Variants
$PROJECT_FILE$ Full filename of project Yes
$PROJECT_NAME$ Filename of project without path or extension Yes
$PROJECT_EXT$ Filename extension of project Yes
$PROJECT_PATH$ File path of project Yes
$SOLUTION_FILE$ Full filename of solution Yes
$SOLUTION_NAME$ Filename of solution without path or extension Yes
$SOLUTION_EXT$ Filename extension of solution Yes
$SOLUTION_PATH$ File path of solution Yes

General

Reserved String Meaning
$clipboard$ Text in clipboard
$end$ Desired position of caret after expansion
$selected$ Current selection; null if there is no selection
$$ Literal '$' character

Symbol Context

Reserved strings expand to values from the context of the caret when the VA Snippet is invoked. The strings expand to null when the position or context of the caret is unavailable, e.g. in VA Snippets used by refactoring features.

Reserved String Meaning
$MethodName$ Name of containing method
$MethodArgs$ Method parameters
$ClassName$ Name of containing class
$BaseClassName$ Name of base class of containing class
$NamespaceName$ Fully qualified namespace name

GUID

Reserved strings expand to Globally Unique Identifiers. All instances of a reserved string in a VA Snippet expand to the same GUID.

Reserved String Meaning Case Variants
$GUID_DEFINITION$ Generated GUID formatted for use in a definition UPPER only
$GUID_STRING$ Generated GUID formatted for use in a string UPPER only
$GUID_STRUCT$ Generated GUID formatted for use in a struct UPPER only
$GUID_SYMBOL$ Generated GUID formatted with underscores UPPER only

Refactor

Reserved strings are unique to the refactoring and code-generation features of Visual Assist, and expand to null when used in other VA Snippets.

Reserved String Meaning
$GeneratedPropertyName$ Property name generated during Encapsulate Field
$generatedPropertyName$ Same as $GeneratedPropertyName$ but with first letter in lowercase
$MethodArg$ One parameter of the method and its type
$MethodArgName$ One parameter of the method
$MethodArgType$ Type of one parameter of the method
$MethodBody$ Body of implementation
$MethodQualifier$ Optional qualifiers of method
$ParameterList$ Parameters separated by commas
$SymbolContext$ Context and name of method
$SymbolName$ Name of method
$SymbolPrivileges$ Access of method
$SymbolStatic$ Keyword static or null
$SymbolType$ Return type of method
$SymbolVirtual$ Keyword virtual or null
$MemberInitializationList$ Initialization list of class created from usage (when parameters are present at call site)
$InitializeMember$ Initialization of member of C struct created from usage (when parameters are present at call site)
$MemberType$ Type of member in class created from usage (when parameters are present at call site)
$MemberName$ Name of member in class created from usage (when parameters are present at call site). Name is copied from call site for non-constants.
$colon$ Colon if class created from usage initializes members (when parameters are present at call site)

Note: Not all reserved strings are available to every VA Snippet used by the refactoring and code-generation features of Visual Assist. Only relevant strings are available to each snippet. If a reserved string causes an unexpected prompt for input when a snippet is expanded, the reserved string is not supported in the snippet.