Recent searches

in

root_value_boundary

On this page

This key defines the boundary tokens required for arguments and values when parsing snippet parameters.

The value is an object that contains start and end properties, each specifying a string token. For example, MDX specifies { start: "{", end: "}" }, which allows syntax such as <Component flag={true} />.

Appears in#

└── Snippet Format
    └── root_value_boundary

Type#

Object

Properties#

end — string#

This key defines the end token for root value boundaries when parsing snippet parameters.

The value is a string that specifies the token that marks the end of a root-level value in snippet parameter parsing. This works together with root_value_boundary.start to define paired tokens that enclose root-level values.

Defaults to:

Appears in: Snippet Format root_value_boundary.

Show examplesHide examples

In this example, we have configured root value boundaries to use double square brackets.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            root_value_boundary:
              start: '[['
              end: ']]'
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "root_value_boundary": {
                "start": "[[",
                "end": "]]"
              }
            }
          }
        }
      }
    }
  }
}
start — string#

This key defines the start token for root value boundaries when parsing snippet parameters.

The value is a string that specifies the token that marks the start of a root-level value in snippet parameter parsing. This works together with root_value_boundary.end to define paired tokens that enclose root-level values.

Defaults to:

Appears in: Snippet Format root_value_boundary.

Show examplesHide examples

In this example, we have configured root value boundaries to use double square brackets.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            root_value_boundary:
              start: '[['
              end: ']]'
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "root_value_boundary": {
                "start": "[[",
                "end": "]]"
              }
            }
          }
        }
      }
    }
  }
}

Examples#

In this example, we have configured root value boundaries to use curly braces.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            root_value_boundary:
              start: '{'
              end: '}'
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "root_value_boundary": {
                "start": "{",
                "end": "}"
              }
            }
          }
        }
      }
    }
  }
}
Open in a new tab