2013-03-23 48 views
0
<snippet> 
    <content><![CDATA[getElement${1/(T)|.*/(?1:s)/}By${1:T}${1/(T)|(I)|.*/(?1:agName)(?2:d)/}('$2')]]></content> 
    <tabTrigger>get</tabTrigger> 
    <scope>source.js</scope> 
    <description>Get Elements</description> 
</snippet> 

我不知道這mean.I瞭解$1,但什麼是(?1:agName)(?2:d) ???你明白這個崇高的片段嗎?

回答

1

你所指出的那些被格式化字符串替換。他們是崇高文本片段替代的一部分,documented -

In addition to the place holder syntax, tab stops can specify more complex operations with substitutions. Use substitutions to dynamically generate text based on a mirrored tab stop. 

The substitution syntax has the following syntaxes: 

${var_name/regex/format_string/} 
${var_name/regex/format_string/options} 

所以在你的片斷,這些都是替代 - ${1/(T)|.*/(?1:s)/}${1:T},。

+0

謝謝,我現在知道了。 – user2201723 2013-03-30 11:16:17