void () { myFixture.configureByText("a.java", """ import java.util.*; public class Main { List<String> getStringList(int i){ List<String> ints = null; <caret> return new ArrayList<>(i); } } """); Template template = getTemplateManager().createTemplate("for", "user", """ for ($ELEMENT_TYPE$ $VAR$ : $ITERABLE_TYPE$) { $END$; }"""); template.addVariable("ITERABLE_TYPE", new MacroCallNode(new CompleteSmartMacro()), new EmptyNode(), true); template.addVariable("VAR", new TextExpression("item"), true); template.addVariable("ELEMENT_TYPE", new TextExpression("String"), true); template.setToReformat(true); startTemplate(template); myFixture.type("in\n"); BaseCompleteMacro.waitForNextTab(); myFixture.checkResult( """ import java.util.*; public class Main { List<String> getStringList(int i){ List<String> ints = null; for (String <selection>item</selection> : ints) { ; } return new ArrayList<>(i); } } """); assert !getState().isFinished(); }