In my project, I have many serialization classes and, to make the classes more readable, I'm standardizing them, with an argument which has the same name of the $class$
, that is $argName$
:
@immutable
class $class$_Serialize extends Serialize<$class$> {
final $class$ $argName$;
$class$_Serialize(this.$argName$);
@override
Map<String, Object> run() => $serialize$
}
In the Live Template above, the annoyance is that I have to retype $argName$
instead of the template simply decapitalizing $class$
. How would I tie $argName$
to the decapitalization of $class$
in IntelliJ?
I've already tried to mess around with editing the variables and adding the decaptialize()
function in the expression column, but so far haven't had much success. It was something like this:
You are using the wrong syntax for the decapitalize
function. It should look like this:
decapitalize(class)
Note that there are no $
signs around the class
in the function argument.