webstrom中快速生成自定义注释
2018-04-20 本文已影响362人
xiao_afei
mac os 下点击webstrom-->preference-->Editor-->Live Templates ,然后点击JavaScript,再点击右上角的加号,选择Live Templates,如下图所示:

然后在弹出的页面进行模板设置,需要设置一下几项:
1.abbreviation:自动完成的提示缩写
2.description:注释的描述,可以忽略不写
3.Template Text:具体的注释模板
4.点击Edit variables 可以设置变量
如下图所示:

然后在options的选项可以勾选Reformat according to style,则在当前光标的位置进行只能缩进,Expand with 选项可以选择一个触发自动完成提示缩写的快捷键,默认是tab键。

接下来在js页面想要加入注释的位置通过设置的提示缩写+上面options设置的按键即可快速生成注释。