Skip to content

Support snippet variables #4956

@martinring

Description

@martinring

The documentation on snippets says:

The snippet syntax follows the TextMate snippet syntax with the exception of 'regular expression replacements', 'interpolated shell code' and 'transformations', which are not supported.

Which implicitly says that VSCode does support variables.

The TextMate documentation on snippet variables says:

You can insert the value of a variable by prefixing the name of the variable with $. All the normal dynamic variables are supported, the most useful probably being TM_SELECTED_TEXT.

Though it does not work, nor does vscode seem to provide an alternative.


  • VSCode Version: 0.10.11
  • OS Version: Fedora 23

Steps to Reproduce:

  1. Create user snippet using variable TM_SELECTED_TEXT
  2. Use snippet
    -> Does not insert the selected text in place of $TM_SELECTED_TEXT

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions