Theia API Documentation v1.65.0
    Preparing search index...

    A snippet string is a template which allows to insert text and to control the editor cursor when insertion happens.

    Index

    Constructors

    Properties

    value: string

    The snippet string.

    Methods

    • Builder-function that appends a choice (${1|a,b,c|}) to the value of this snippet string.

      Parameters

      • values: string[]

        The values for choices - the array of strings

      • Optionalnumber: number

        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 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.

      • Optionalnumber: number

        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 value of this snippet string.

      Parameters

      • Optionalnumber: number

        The number of this tabstop, defaults to an auto-increment value starting at 1.

      Returns SnippetString

      This snippet string.

    • Builder-function that appends a variable (${VAR}) to the value of this snippet string.

      Parameters

      • name: string

        The name of the variable - excluding the $.

      • defaultValue: 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.