Variable-length snippet

I have a situation where the number of variables that need to be filled in by a snippet is variable. For example:

String var1;
String var2;
String var3;

Function(String var1, String var2, String var3)

Is there a way to do this with Atom snippets? The idea is that I want the variable names to be filled in with the multi-cursor, but the format is slightly different on each spot. If the number of variables was fixed, it would look something like:

$1;
$2;
$3;

Function($1, $2, $3)

Snippets in Atom does not provide this type behaviour.
You will need to source a solution from a package or scripting the init file.

1 Like