In November 2016 (version 1.8), the VSCode Snippet Variables version , in particular TM_SELECTED_TEXT, is now supported .
This makes me happy as I used them in Sublime Text and TextMate.
I cannot figure out how to make it work in VSCode. I created a snippet that they use as an example:
"in quotes": {
"prefix": "inq",
"body": "'${TM_SELECTED_TEXT:${1:type_here}}'"
}
Then I enter some text, select it and that where something starts to break.
The idea selects some text, starts the fragment, and then ${TM_SELECTED_TEXT:${1:type_here}}is replaced by the selected text. The problem I ran into is that to run the fragment, you need to enter a value prefix(inq in this case) to run the fragment that overwrites the selected text that messed everything up.
In Sublime / Textmate, I ran a snippet from a key combination that left my text selected.
Is there a way, in VSCode, to either make this work as is, or to run a fragment from a key combination, as was available in Sublime?
Jason source
share