The snippet string.
Builder-function that appends the given string to
the value
of this snippet string.
A value to append 'as given'. The string will be escaped.
This snippet string.
Builder-function that appends a tabstop ($1
, $2
etc) to
the value
of this snippet string.
The number of this tabstop, defaults to an auto-increment value starting at 1.
This snippet string.
Builder-function that appends a placeholder (${1:value}
) to
the value
of this snippet string.
The value of this placeholder - either a string or a function with which a nested snippet can be created.
The number of this tabstop, defaults to an auto-increment value starting at 1.
This snippet string.
Builder-function that appends a choice (${1|a,b,c|}
) to
the value
of this snippet string.
The values for choices - the array of strings
The number of this tabstop, defaults to an auto-increment value starting at 1.
This snippet string.
Builder-function that appends a variable (${VAR}
) to
the value
of this snippet string.
The name of the variable - excluding the $
.
The default value which is used when the variable name cannot be resolved - either a string or a function with which a nested snippet can be created.
This snippet string.
友链:VS Code 中文文档 | VS Code 官网文档 | VS Code 扩展市场
A snippet string is a template which allows to insert text and to control the editor cursor when insertion happens.
A snippet can define tab stops and placeholders with
$1
,$2
and${3:foo}
.$0
defines the final tab stop, it defaults to the end of the snippet. Variables are defined with$name
and${name:default value}
. The full snippet syntax is documented here.