Search in sources :

Example 1 with VariableNode

use of com.intellij.codeInsight.template.impl.VariableNode in project intellij-community by JetBrains.

the class ForeachPostfixTemplate method setVariables.

@Override
public void setVariables(@NotNull Template template, @NotNull PsiElement element) {
    MacroCallNode type = new MacroCallNode(new IterableComponentTypeMacro());
    MacroCallNode name = new MacroCallNode(new SuggestVariableNameMacro());
    type.addParameter(new VariableNode("expr", null));
    template.addVariable("type", type, type, false);
    template.addVariable("name", name, name, true);
}
Also used : VariableNode(com.intellij.codeInsight.template.impl.VariableNode) IterableComponentTypeMacro(com.intellij.codeInsight.template.macro.IterableComponentTypeMacro) SuggestVariableNameMacro(com.intellij.codeInsight.template.macro.SuggestVariableNameMacro) MacroCallNode(com.intellij.codeInsight.template.impl.MacroCallNode)

Aggregations

MacroCallNode (com.intellij.codeInsight.template.impl.MacroCallNode)1 VariableNode (com.intellij.codeInsight.template.impl.VariableNode)1 IterableComponentTypeMacro (com.intellij.codeInsight.template.macro.IterableComponentTypeMacro)1 SuggestVariableNameMacro (com.intellij.codeInsight.template.macro.SuggestVariableNameMacro)1