I wrote this snippet to insert a new variable into Java source:
# -*- mode: snippet -*-
# name: variable
# key: v
# --
$1 ${1:$(java-default-variable-name text)} = new $1($2);
$0
It declares and creates a variable based on the type, e.g.
AtomicInteger-> AtomicInteger ai = new AtomicInteger();
What is missing is that I can't give another variable name inside the snippet, if I don't like the default one. I've tried to write:
$1 ${2:$(java-default-variable-name $1)}
or
$1 ${2:`(java-default-variable-name $1)`}
But it doesn't work. Is there a way to make a transformation of field $1 into field $2?