draivin / hsnips

HyperSnips: a powerful snippet engine for VS Code, inspired by vim's UltiSnips
MIT License
148 stars 23 forks source link

Cannot get tab stops which include choices #193

Open Mark-hub-work opened 1 month ago

Mark-hub-work commented 1 month ago

I'm not sure if hypersnips is supposed to allow for this or not but in the VSCode snippets you can add choices or placeholders to your tab stops like this:

snippet hypertest "Will let you echo a field"
echo \$fields->render_field('${1:field_name}'
  [
    'type' => '${2|accordion,alignment_matrix,angle_picker,border,button_group,checkbox,color_picker,combo_box,date_picker,dimensions,field_group,file,gallery,gradient,hidden,number,radio,select,simple_dimension,switch,text,text_suggestion,textarea,wysiwyg'|}',
    ``rv= `field 1 has ${t[0].length} characters!` ``

endsnippet

But if I try to get the length of either of these tab stops their length will be 0. If I try to get the text from the tab stops they will be empty. If I change them to $1 and $2 they will work as intended.

So does hypersnips not support these kind of tab stops, or do you access them using some other syntax?