Webstrom Official Activity Template Introduction

Source: Internet
Author: User
Tags javascript array

Edit Template variable dialog box

File | settings | Life templates--edit variables windows and Linux
Webstorm | preferences | Life templates--edit variables in OS X
Ctrl + Alt + S

When you click on the dialog box open the Edit Variable button template text Area field template Page.

The edit variable enables the button only if the body of the template contains at least one user-defined variable, that is, a variable  $END$ or different $SELECTION$ .

Use this dialog box to create and edit a template for a variable selection in an Expression.

On this page:

    • Control
    • Pre-defined functions are used in the life template variable

Control

Items Description
's name In this text box, view or edit the variable name format  $<variable_name>$ .
An expression In this text box, the value of the specified expression corresponds to the template input field that is automatically Calculated.

This expression can consist of constructing the following basic types:

  • In a double-quoted string constant.
  • The name of another variable is defined in a Template.
  • pre-defined functions and possible arguments.

Enter an expression manually or select a pre-defined feature from the Drop-down List. The list shows the number and type of parameters, if any, of the selected Features. Lists the available function menu in alphabetical order.

Default value In this text box, specify the default string to enter an extension template for the appropriate input field, if the expression evaluates without giving any results.

Note that the default value of a variable is an expression that can refer to other life template Variables. Define default values as a literal, enclosed in quotation marks.

Skip if define ??? After this check box, Webstorm continues the next input field if the value of the input field is currently Defined.
Move Up/down Use these buttons to change the order of the variables in the List. The order in which variables are determined in the order table Webstorm will be expanded when the corresponding input field template is Toggled.

pre-defined functions are used in the Life template variable

Items Description
camelCase(String) The return string is passed as a parameter, and is converted to Camel-case. For example,  my-text-file / my text file / my_text_file will be converted to  myTextFile .
capitalize(String) The first letter is to be capitalized, and the name is passed as a parameter.
capitalizeAndUnderscore(sCamelCaseName) The names of all uppercase letters within the CamelCase are passed as parameters, and an underscore is inserted between the Parts. For example, If the string is passed as a parameter  FooBar , then the function returns  FOO_BAR .
classNameComplete() The alternative category name for this expression is completed at the position of the Variable.
clipboard() Returns the contents of the system Clipboard.
snakeCase(String) Snake_case returns a string of CamelCase strings. For example, If the string is passed as a parameter  foo_bar , then the function returns  fooBar .
complete() This expression overrides the code of the variable to complete the call Location.
completeSmart() The smart type of this expression substitute completes the position of the calling Variable.
date(sDate) Returns the specified format for the current system Date.

By default, The current date is returned in the system default Format. however, If you specify a date format in double quotation marks, the date in this format will:

decapitalize(sName) Replace the first letter of the name with the corresponding lowercase letter as a parameter pass.
enum(sCompletionString1,sCompletionString2,...) A comma-delimited list of strings is displayed as a completion template Call.
escapeString(sEscapeString) The specified string.
expectedType() The return type is expected due to the entire Template. It makes sense if the template expands on the right part of the task, and then Returns.
fileName(sFileName) Returns the file name and Extension.
fileNameWithoutExtension() The name of the returned file is not Extended.
firstWord(sFirstWord) The first word of the returned string is passed as a parameter.
lineNumber() Returns the current line Number.
lowercaseAndDash(String) dashes, which return lowercase separate strings as arguments are Passed. For example, the string MyExampleName is converted to a  my-example-name .
snakeCase(sCamelCaseText) CamelCase returns a string of snake_case strings as a parameter pass.
spaceSeparated(String) The return string is passed as an argument with a space-separated CamelCase string. For example, If the string is passed as a parameter  fooBar , then the function returns  foo bar .
time(sSystemTime) Returns the current system Time.
underscoresToCamelCase(sCamelCaseText) The returned string is passed as a parameter camelhump the letter is replaced with an underscore. For example, If the string is passed as a parameter  foo_bar , then the function returns  fooBar .
underscoresToSpaces(sParameterWithSpaces) The returned string is passed as a parameter with a space replaced by an underscore.
user() Returns the name of the current User.
JsArrayVariable Returns the name of the JavaScript array.
jsClassName() Returns the name of the current JavaScript class.
jsComponentType Returns the JavaScript component Type.
jsMethodName() Returns the name of the current JavaScript method.
jsQualifiedClassName Returns the full name of the current JavaScript class.
jsSuggestIndexName Returns a suggested Index.
jsSuggestVariableName Returns a suggestion named as a variable.

Webstrom Official Activity Template Introduction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.