Package com.intellij.codeInsight.template.impl

Examples of com.intellij.codeInsight.template.impl.ConstantNode


import org.jetbrains.annotations.NotNull;

public class ErlangUnitTestMethodAction extends CodeInsightAction implements CodeInsightActionHandler {
  private static void insertTestFunction(@NotNull Project project, @NotNull Editor editor, String name, boolean needNewline) {
    Template template = TemplateManager.getInstance(project).createTemplate("", "");
    Expression nameExpr = new ConstantNode(name);
    Expression expected = new ConstantNode("expected");
    Expression expr = new ConstantNode("expr");
    template.addTextSegment("\n" + (needNewline ? "\n" : ""));
    template.addVariable("name", nameExpr, nameExpr, true);
    template.addTextSegment("_test() ->\n");
    template.addTextSegment("?assertEqual(");
    template.addVariable(expected, true);
View Full Code Here


          TemplateManager manager = TemplateManager.getInstance(project);
          Template template = manager.createTemplate("", "");

          template.addTextSegment(((ErlangQVar) psiElement).getName());
          template.addTextSegment(" = ");
          template.addVariable(new ConstantNode("unbound"), true);
          template.addTextSegment("");
          template.addEndVariable();
          template.addTextSegment(",\n");

          manager.startTemplate(editor, template);
View Full Code Here

        template.addTextSegment("\n\n");
        template.addTextSegment(myName + "(");
        int size = placeHolders.size();
        for (int i = 0; i < placeHolders.size(); i++) {
          String name = placeHolders.get(i);
          template.addVariable("param" + i, new ConstantNode(name), true);
          if (i != size - 1) template.addTextSegment(", ");
        }
        template.addTextSegment(") ->\n");
        template.addEndVariable();
        template.addTextSegment("error(not_implemented).");
View Full Code Here

    Template template = templateManager.createTemplate("", "");

    template.setToReformat(true);
    template.addTextSegment("-define(" + macroName + ", ");
    template.addVariable("macro_body", new ConstantNode("macro_body"), true);
    template.addTextSegment(").");
    template.addEndVariable();
    template.addTextSegment("\n");

    return template;
View Full Code Here

TOP

Related Classes of com.intellij.codeInsight.template.impl.ConstantNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.