![]() Invokes smart type completion at the position of the variable. ![]() Invokes code completion at the position of the variable. ![]() For languages with line comments, the return value is the start of a line comment, same as lineCommentStart(). Returns the characters that indicate the start of a comment in the current language context. For languages with line comments, the return value is empty. Returns the characters that indicate the end of a comment in the current language context. Returns the contents of the system clipboard. Or you can combine it into capitalize(camelCase("my awesome class")) to get MyAwesomeClass.Ĭapitalizes all the letters of a string, and inserts an underscore between the parts.įor example, capitalizeAndUnderscore("FooBar"), capitalizeAndUnderscore("foo bar"), and capitalizeAndUnderscore("foo-bar") all return FOO_BAR. Returns the characters that indicate the start of a block comment in the current language context.įor example, camelCase("my-text-file"), camelCase("my text file"), and camelCase("my_text_file") all return myTextFile.Ĭapitalizes the first letter of a string.įor example, capitalize("name") returns Name. Returns the characters that indicate the end of a block comment in the current language context. The following functions can be used to define live template variables: 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 |