Eclipse templates can automatically insert text and variables as you are coding. When variables are used with the ${variable} form, the value is inserted automatically.
My question is whether you can add sections to these templates conditionally. Can you have a method definition template that will fill in multiple variables and add local definitions of them, but only if they are filled in?
def method(${var1}, ${var2}, ${var3}):
self.${var1} = ${var1}
self.${var2} = ${var2}
self.${var3} = ${var3}
So, the ${var2} and ${var3} local variables would only exist if their definitions existed in the method definition?
This question is specifically for Python development with PyDev but answers for other languages would be welcome too.