![]() For example, if you select EXAMPLE in your code and invoke the "$SELECTION$" template via the assigned abbreviation or by pressing Control+Alt+T and selecting the desired template from the list, DataGrip will wrap the selection in double quotes as follows: "EXAMPLE".įunctions used in live template variables After the template expands, it wraps the selected text as specified in the template. $SELECTION$ is used in surround templates and denotes the code fragment to be wrapped. $END$ indicates the position of the caret when the code snippet is complete, and you can no longer press Tab to jump to the next variable. Specify whether you want to skip the variable when prompting the user for input if the expression evaluated successfully.ĭataGrip supports the following predefined live template variables that cannot be modified: The default value should be enclosed in double quotation marks. ![]() Specify the default value for cases when the expression fails to evaluate. In the Edit Template Variables dialog, you can do the following for each variable:ĭefine an expression using predefined functions. Specify variables in the template text and click Edit Variables…. Select a template where you want to configure variables. In the Settings dialog ( Control+Alt+S), go to Editor | Live Templates. ![]() Predefined functions with possible arguments Names of other variables defined in a live template This expression may contain the following constructs: To add a dollar character $ to the template text so that it is not treated as a variable declaration, use the special variable $$.ĭefine each variable using an expression and provide a default value for cases when the expression fails to evaluate. In expressions, use variable names without opening and closing dollar characters $, for example, lowercaseAndDash(ComponentName). To declare variables within templates, use the following format: $VAR$. These may be default values that you can modify or values calculated using functions. When you expand a live template abbreviation, its variables either appear as input fields where you can type values or are replaced with values.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |