Edit Template Variables dialog
|Name||In this field, view or edit the variable name in the format |
|Expression|| In this field, specify the expression to have the value of the corresponding template input field calculated automatically. |
This expression may contain the following constructs:
Type an expression manually or select a predefined function from the list. The list shows also the number and type of parameters, if any, for the selected function. The available functions are listed alphabetically in the Functions table.
|Default value||In this field, specify the default string to be entered in the corresponding input field of the expanded template, if the expression does not give any result after calculation. |
Note that a default value of a variable is an expression that can refer to other live template variables. To define the default value as a literal, enclose it in quotation marks.
|Skip if defined||Select this checkbox to have JetBrains Rider proceed with the next input field, if the value of the current input field is defined.|
|Move Up / Move Down||Use these buttons to change the order of variables in the list. The order of variables in the table determines the order in which JetBrains Rider will switch between the corresponding input fields when the template is expanded.|
Functions used in live template variables
Converts a string into camelCase.
Capitalizes the first letter of a string.
Capitalizes all the letters of a string, and inserts an underscore between the parts.
| ||Invokes code completion at the position of the variable.|
| ||Invokes smart type completion at the position of the variable.|
Returns a concatenation of all the strings passed to the function as parameters.
Returns the current system date.
By default, without a parameter, it returns the date in the current system format. To use a different format, provide a parameter according to the SimpleDateFormat specification. For example, the
Replaces the first letter of a string with the corresponding lowercase letter.
| ||Returns the default value if the expression is used in the return statement. Uses the |
Returns a list of strings suggested for completion when the template expands.
Escapes special characters so that the result can be used in a Java string.
For example, it replaces the tab character with
| || Returns the expected type of the expression where the template expands (in the right part of an assignment, after |
| ||Returns the name of the current file with its extension.|
| ||Returns the name of the current file without its extension.|
| ||Returns the absolute path to the current file.|
| ||Returns the current file path relative to the current project. To check what the relative path is for a given file, right-click it and select Copy Reference, or press Ctrl+Alt+Shift+C .|
Returns the first word of the string passed as the parameter.
| ||Returns the current line number.|
| || Converts a string into lower case and inserts n-dashes as separators. For example, |
| || Finds all occurrences of |
| || Converts a string into snake_case. For example, |
| || Returns the specified string with spaces as separators. For example, |
| || Replaces spaces with underscores in the string passed as the parameter. For example, |
| || Returns the substring up to the specified delimiter. This is helpful for removing the extensions in test file names. For example, |
Returns the current system time.
By default, without a parameter, it returns the time in the current system format. To use a different format, provide a parameter according to the SimpleDateFormat specification. For example, the
| || Transforms a string with underscores (like snake_case) into camelCase. For example, |
| || Transforms underscores in a string to spaces. For example, |
| ||Returns the name of the current user.|