void (TemplateBuilderImpl builder) { int caretOffset = myEditor.getCaretModel().getOffset(); TextRange range = myPsiFile.getTextRange(); assert range != null; RangeMarker rangeMarker = myEditor.getDocument().createRangeMarker(range); Template template = builder.buildInlineTemplate(); template.setToShortenLongNames(false); template.setToReformat(false); myEditor.getCaretModel().moveToOffset(rangeMarker.getStartOffset()); TemplateManager.getInstance(myProject).startTemplate(myEditor, template, new MyTemplateListener()); restoreOldCaretPositionAndSelection(caretOffset); myHighlighters = new ArrayList<>(); highlightTemplateVariables(template); }