SnippetString class
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.
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
Constructors
- SnippetString.new([String? value])
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ String
-
Available on SnippetString, provided by the SnippetString$Typings extension
The snippet string.getter/setter pair
Methods
-
appendChoice(
List< String> values, [num? number]) → SnippetString -
Available on SnippetString, provided by the SnippetString$Typings extension
Builder-function that appends a choice (${1|a,b,c|}
) to the {@linkcode SnippetString.value value} of this snippet string. -
appendPlaceholder(
Object value, [num? number]) → SnippetString -
Available on SnippetString, provided by the SnippetString$Typings extension
Builder-function that appends a placeholder (${1:value}
) to the {@linkcode SnippetString.value value} of this snippet string. -
appendTabstop(
[num? number]) → SnippetString -
Available on SnippetString, provided by the SnippetString$Typings extension
Builder-function that appends a tabstop ($1
,$2
etc) to the {@linkcode SnippetString.value value} of this snippet string. -
appendText(
String string) → SnippetString -
Available on SnippetString, provided by the SnippetString$Typings extension
Builder-function that appends the given string to the {@linkcode SnippetString.value value} of this snippet string. -
appendVariable(
String name, Object defaultValue) → SnippetString -
Available on SnippetString, provided by the SnippetString$Typings extension
Builder-function that appends a variable (${VAR}
) to the {@linkcode SnippetString.value value} of this snippet string. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited