WebStorm - Live templates - indicate the order of focusing the same variable

吃可爱长大的小学妹 提交于 2019-11-27 08:03:12

问题


I am interested in if there is a mean to indicate where the writing the variable name should start

e.g if I call this live template:

console.log('$TEXT$', $TEXT$);
             ^

It will start writing from the first TEXT variable.

I want to start writing from the second one:

console.log('$TEXT$', $TEXT$);
                      ^

回答1:


You cannot do that for the same variable as each variable is processed only once.

Solution:

  1. Give them different names

    console.log('$TEXT$', $VAR$);$END$
    

    (I've also added $END$ to denote final cursor position)

  2. Click on Edit Variables button

  3. Rearrange variables in desired order (using Up / Down buttons on the right side)

  4. Assign TEXT variable default text -- the value that you will enter into VAR variable.

  5. Also check Skip if defined if you do not plan to edit the TEXT afterwards.

Result:

Related StackOverflow question: https://stackoverflow.com/a/40606436/783119



来源:https://stackoverflow.com/questions/41630973/webstorm-live-templates-indicate-the-order-of-focusing-the-same-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!