How to pass parameter into code-template in eclipse-plugin -
I want to create a plugin that defines a new code template (). How can I give a parameter in a template? Like $ {name: param}
?
There are not many things that you can pass in a code template. For example, the current selection is in $ {word_selection}
.
But the people who are missing is that you can define your own variable:
private static last $ {type} $ {name} = New $ {type} ($ {cursor});
Neither $ {type}
and $ {name}
are in the list that you click on "Variable Variables" . .. "button allows you to cycle through the eclipse notice and with the tab and it will keep the contents of these custom" template fields "in sync (so that you can see the new
If you write in the first field).
.
[edit] According to the answers given in the blog post, which you mention, It is possible only with the template template, no code templates I lose the API for it For who would like to suggest to file a bug against JDT text.
Comments
Post a Comment