Community
Participate
Working Groups
I'm at the moment learning the JDT template approach. Cool stuff you have. Why not add a template for defining a local variable: ${variabletype} ${myvar:newName(var)}= new ${variabletype}(${cursor}); As in Bug 387272, I'm happy to supply a patch.
This could also be used to declare fields ==> name: "variable" description: "variable declaration"
@Dani: How can I create a template which allows to create either a local variable or a field?
(In reply to comment #2) > @Dani: How can I create a template which allows to create either a local > variable or a field? Take a look at the 'static_final' template.
I would like to tackle this in context of the #greatfix initiative, please assign me and add the greatfix keyword. As a similar template exists already (the "new" template) I will update that to set the cursor to the constructor arguments instead of just hardcoding "arguments" string there, which will be uncompilable unless you have a variable with that name.
New Gerrit change created: https://git.eclipse.org/r/44786
(In reply to Eclipse Genie from comment #5) > New Gerrit change created: https://git.eclipse.org/r/44786 See my comment there. I've simply removed the "arguments" name, so that one can either tab into the constructor or go to the end with Enter. Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=0663778d660e5863ed8d9acdc6e3f54aae647c3d Lars, I'm not convinced anymore that we need a more complicated template than "new" already gives us.
(In reply to Dani Megert from comment #6) > > Lars, I'm not convinced anymore that we need a more complicated template > than "new" already gives us. I agree.