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}
. Also see
the full snippet syntax.
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}`. Also see [the full snippet syntax](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets).
(append-choice snippet-string values)
(append-choice snippet-string values number)
Builder-function that appends a choice (${1|a,b,c|}
) to
the {@linkcode SnippetString.value value} of this snippet string.
Parameters:
values
: readonly string[]
- The values for choices - the array of stringsnumber
: number | undefined
- The number of this tabstop, defaults to an auto-increment
value starting at 1.Returns: SnippetString
- This snippet string.
Builder-function that appends a choice (`${1|a,b,c|}`) to the {@linkcode SnippetString.value value} of this snippet string. **Parameters:** - `values`: `readonly string[]` - The values for choices - the array of strings - `number`: `number | undefined` - The number of this tabstop, defaults to an auto-increment value starting at 1. **Returns:** `SnippetString` - This snippet string.
(append-placeholder snippet-string value)
(append-placeholder snippet-string value number)
Builder-function that appends a placeholder (${1:value}
) to
the {@linkcode SnippetString.value value} of this snippet string.
Parameters:
value
: string | ((snippet: SnippetString) => any)
- The value of this placeholder - either a string or a function
with which a nested snippet can be created.number
: number | undefined
- The number of this tabstop, defaults to an auto-increment
value starting at 1.Returns: SnippetString
- This snippet string.
Builder-function that appends a placeholder (`${1:value}`) to the {@linkcode SnippetString.value value} of this snippet string. **Parameters:** - `value`: `string | ((snippet: SnippetString) => any)` - The value of this placeholder - either a string or a function with which a nested snippet can be created. - `number`: `number | undefined` - The number of this tabstop, defaults to an auto-increment value starting at 1. **Returns:** `SnippetString` - This snippet string.
(append-tabstop snippet-string)
(append-tabstop snippet-string number)
Builder-function that appends a tabstop ($1
, $2
etc) to
the {@linkcode SnippetString.value value} of this snippet string.
Parameters:
number
: number | undefined
- The number of this tabstop, defaults to an auto-increment
value starting at 1.Returns: SnippetString
- This snippet string.
Builder-function that appends a tabstop (`$1`, `$2` etc) to the {@linkcode SnippetString.value value} of this snippet string. **Parameters:** - `number`: `number | undefined` - The number of this tabstop, defaults to an auto-increment value starting at 1. **Returns:** `SnippetString` - This snippet string.
(append-text snippet-string string)
Builder-function that appends the given string to the {@linkcode SnippetString.value value} of this snippet string.
Parameters:
string
: string
- A value to append 'as given'. The string will be escaped.Returns: SnippetString
- This snippet string.
Builder-function that appends the given string to the {@linkcode SnippetString.value value} of this snippet string. **Parameters:** - `string`: `string` - A value to append 'as given'. The string will be escaped. **Returns:** `SnippetString` - This snippet string.
(append-variable snippet-string name default-value)
Builder-function that appends a variable (${VAR}
) to
the {@linkcode SnippetString.value value} of this snippet string.
Parameters:
name
: string
- The name of the variable - excluding the $
.default-value
: string | ((snippet: SnippetString) => any)
- 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.Returns: SnippetString
- This snippet string.
Builder-function that appends a variable (`${VAR}`) to the {@linkcode SnippetString.value value} of this snippet string. **Parameters:** - `name`: `string` - The name of the variable - excluding the `$`. - `default-value`: `string | ((snippet: SnippetString) => any)` - 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. **Returns:** `SnippetString` - This snippet string.
(set-value! snippet-string value)
The snippet string.
The snippet string.
(value snippet-string)
The snippet string.
Returns: string
The snippet string. **Returns:** `string`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close