Vsnips
Vsnips copied to clipboard
增加对于js函数返回值的索引的支持
下面是all.snippets中的一个片段
snippet todo "TODO comment" bw
`!p snip.rv=get_comment_format()[0]` ${2:TODO}: $0${3: <${4:`!v strftime('%d-%m-%y')`}${5:, `!v g:snips_author`}>} `!p snip.rv=get_comment_format()[2]`
endsnippet
片段中比较重要的部分就是:!p snip.rv=get_comment_format()[0]
该模板需要被分为两部分解析:
get_comment_format
,与[0]
其中, get_comment_format
用于获取当前源代码的注释方式, 需要在补全时方能知道