(また、設定文書のヘッダーコメントと呼ばれる)WebStormカスタムドキュメンテーションコメントテンプレート

前提:

  かどうかWebStrom書き込みHTML、JavaScriptを使用してまたはいくつかのドキュメントを伴います。具体的には、文書注釈の頭。

  限り、あなたはページを書いて、ヘッドノートは、基本的な合意を説明します。常にそれが再び書くのか?これは、コンピュータのスタイルをプレイするようではなかったです。

  下記の方法。この問題を解決するには。

  一方ヒント:フォローアップのメンテナンスを容易にするために、適切なコーディングプラクティス、コードの標準化、規範のコメントを開発します。

 

ドキュメントノート  :
(文書について説明し、作者、作成日など)を含むWebStorm、カスタムの説明メモテンプレート: 

 

カスタム注釈を開始するテンプレート

まず、メニューバーにある--->文書--->設定を見つけます。

               

 

   ショートカットキーまたは直接オープンWebstormセット、見つけることができない直接探索を次のように」とは、右のメニューを選択するために進行します。 Ctrl + Alt + S Live Template

       

 

 

第二には、「右上隅をクリックして+」 - > 、コメントのテンプレート、次の画面は、関連する情報で塗りつぶしを追加します。詳細は以下のとおりです。 Live Template

      

 

  第五の工程は、「編集変数」、ここについて言った時間($日付$)特定のフォーマット、およびJavaの形式は、Baiduは半分右半分間違って記録され、同じではありません。再適用するにはコンピュータの次回を防ぐために。

      日付( "YYYY-MM-DD HH:MM:SS")

 

  

 

  第6のステップ、「変更」テンプレートアプリケーションの選択。総選挙は、全体だけで罰金ではありません。ねえ。このショートカットを使用して、私は、HTMLのみ。ただ、関連するHTMLを確認してください。

      アプリケーションの項目テンプレートを選択し、エラーのために投票しない、必須です。保存できません。

                       

 

  最后,详细介绍的一下第五步的  Edit variables 到底有哪些参数可用。如下图:(图片来源于网络,byx收集记录)

  

Item

Description

blockCommentEnd

Returns the characters that indicate the end of a block comment in the current language context.返回指示当前语言上下文中块注释结尾的字符。

blockCommentStart

Returns the characters that indicate the start of a block comment in the current language context.返回指示当前语言上下文中块注释开头的字符。

camelCase(String)

Converts a string into camelCase. For example, camelCase(my-text-file)camelCase(my text file), and camelCase(my_text_file) all return myTextFile.

将字符串转换为驼色大小写。例如, camelCase(my-text-file), camelCase(my text file), and camelCase(my_text_file) 这三种都返回 myTextFile.

capitalize(String)

Capitalizes the first letter of the parameter.

将参数的第一个字母大写。

capitalizeAndUnderscore(sCamelCaseName)

Capitalizes all the letters of a CamelCase name passed as the parameter, and inserts an underscore between the parts. For example, capitalizeAndUnderscore(FooBar) returnsFOO_BAR.

将参数所有字母大写,并在各部分之间插入下划线。例如,如capitalizeAndUnderscore(FooBar),返回FOO_BAR

classNameComplete()

This expression substitutes for the class name completion at the variable position.

此表达式在变量位置替换类名完成。

clipboard()

Returns the contents of the system clipboard.

返回系统剪贴板的内容。

commentEnd()

Returns the characters that indicate the end of a comment in the current language context. The return value is empty if line comments are defined in the current language.

返回指示当前语言上下文中注释结尾的字符。如果行注释是用当前语言定义的,则返回值为空。

commentStart()

Returns the characters that indicate the start of a comment in the current language context. If line comments are defined in the current language, their start indicator is preferable.

返回指示当前语言上下文中注释开头的字符。如果行注释是用当前语言定义的,则它们的开始指示符更可取。

complete()

Invokes code completion at the position of the variable.

在变量的位置自动识别代码

completeSmart()

Invokes smart type completion at the position of the variable.

在变量的位置调用智能类型完成。

concat(expressions...)

Returns a concatenation of all the strings passed to the function as parameters.

返回串联的所有参数

dartIterableVariable()

Returns the name of a variable that can be iterated.

返回可迭代的变量的名称。

dartListVariable()

Returns a list of elements of an array.

返回数组元素的列表。

dartSuggestIndexName()

Returns a suggested name for an index variable from most commonly used ones: ijk, etc. The names that are not used in the current scope yet are shown first.

回最常用的索引变量的建议名称:i、j、k等。当前作用域中尚未使用的名称将首先显示。

dartSuggestVariableName()

Returns the suggested name for a variable based on its variable type and initializer expression, according to your code style settings that refer to the variable naming rules.
For example, if it is a variable that holds an element within an iteration, WebStorm makes a guess on the most reasonable name, taking into account the name of the container that is iterated.

date(sDate)

Returns the current system date in the specified format.

Without a parameter, the current date is returned in the default system format.

以指定格式返回当前系统日期。

如果没有参数,则以默认系统格式返回当前日期。

decapitalize(sName)

Replaces the first letter of the parameter with the corresponding lowercase letter.

将参数的第一个字母替换为相应的小写字母。

enum(sCompletionString1,sCompletionString2,...)

Returns a list of comma-separated strings suggested for completion when the template is expanded.

返回在扩展模板时建议完成的逗号分隔字符串列表。

escapeString(sEscapeString)

Escapes the string specified as the parameter.

转义指定为参数的字符串。

expectedType()

Returns the expected type of the expression into which the template expands. Makes sense if the template expands in the right part of an assignment, after return, etc.

当模板扩展中返回表达式的预期类型,如果模板在分配的正确部分、返回后等进行扩展,则是有意义的。

fileName()

Returns the name of the current file with its extension.

返回当前文件的名称及其扩展名。

fileNameWithoutExtension()

Returns the name of the current file without its extension.

返回不带扩展名的当前文件的名称。

firstWord(sFirstWord)

Returns the first word of the string passed as the parameter.

返回作为参数传递的字符串的第一个字。

groovyScript("groovy code", arg1)

Returns a Groovy script with the specified code.

You can use the groovyScript() function with multiple arguments. The first argument is the text of the script that is executed or the path to the file that contains the script. The next arguments are bound to the _1_2_3, ..._n variables that are available inside your script. Also, the _editor variable is available inside the script. This variable is bound to the current editor.

JsArrayVariable()

Returns the name of the current JavaScript array.

jsClassName()

Returns the name of the current JavaScript class.

返回当前javascript类的名称。

jsComponentTypeOf()

Returns the type of the current JavaScript component.

返回当前javascript组件的类型。

jsDefineParameter

Based on the name of the module, returns the parameter fromdefine(["module"], function (<parameter_in_question>>) {}).

根据模块的名称,返回参数fromdefine([“module”]、function(<parameter_in_question>>))。

jsMethodName()

Returns the name of the current JavaScript method.

返回当前javascript方法的名称。

jsQualifiedClassName()

Returns the complete name of the current JavaScript class.

jsSuggestIndexName()

Returns a suggested name for an index variable from most commonly used ones: ijk, etc. The names that are not used in the current scope yet are shown first.

jsSuggestVariableName()

Returns the suggested name for a variable based on its variable type and initializer expression, according to your code style settings that refer to the variable naming rules.
For example, if it is a variable that holds an element within an iteration, WebStorm makes a guess on the most reasonable name, taking into account the name of the container that is iterated.

jsSuggestDefaultVariableKind(Boolean)

The Boolean parameter determines whether constants are allowed or not in the current context. If no parameter is specified, constants are allowed. When the templates expands, a drop-down list is shown with varletconst options for TypeScript and ES6 and with only one var option for earlier JavaScript versions.

jsSuggestImportedEntityName()

Suggests the name for import statements of the type`import * as $ITEM$ from "$MODULE$"` or `import $ITEM$ from "$MODULE$"` based on the file name.

lineCommentStart

Returns the characters that indicate the start of a line comment in the current language context.

返回在当前语言上下文中指示行注释开头的字符。

lineNumber()

Returns the current line number.

返回当前行号。

lowercaseAndDash(String)

Converts a camelCase string into lower case and inserts n-dashes as separators. For example, lowercaseAndDash(MyExampleName) returns my-example-name.

字符串转换为小写,并插入n个-作为分隔符,例如 lowercaseAndDash(MyExampleName) returns my-example-name

snakeCase(String)

Converts a string into snake_case. For example, snakeCase(fooBar) returns foo_bar.

将字符串转换为蛇形命名法。例如,snakecase(foo bar)返回foo_bar。

spaceSeparated(String)

Converts a string into lowercase and inserts spaces as separators. For example, spaceSeparated(fooBar) returns foo bar.

将字符串转换为小写并插入空格作为分隔符。例如,spaceseparated(foo bar)返回foo bar。

substringBefore(String,Delimiter)

Removes the extension after the specified delimiter and returns only the file name. This is helpful for test file names (for example, substringBefore($FileName$,".") returns component-test in component-test.js).

删除指定分隔符后的扩展名,并仅返回文件名。这有助于测试文件名(例如,$filename$,“.”之前的子字符串)返回component test in component test.js。

time(sSystemTime)

Returns the current system time in the specified format.

以指定格式返回当前系统时间。

underscoresToCamelCase(String)

Replaces underscores with camelCase letters in the string passed as the parameter. For example, underscoresToCamelCase(foo_bar) returns fooBar.

替换下划线。例如,underlinestocamelcase(foo_bar)返回foo bar。

underscoresToSpaces(sParameterWithUnderscores)

Replaces underscores with spaces in the string passed as the parameter. For example, underscoresToSpaces(foo_bar) returns foo bar.

将参数中的下划线替换成空格,如underscoresToSpaces(foo_bar)返回foo bar

user()

Returns the name of the current user.

返回当前用户的名称。

 

三、在HTML代码中,输入 /// + Tab 键即可 自动生成 自定的 文档头部 注释模板了!!! 

  

 

 

希望可以帮到你。

 

by不言谢。

おすすめ

転載: www.cnblogs.com/byx1024/p/12208009.html