void (PsiMethod method, Map<String, String> params, TemplateResource template) { PsiFile containingFile = clazz.getContainingFile(); if (containingFile instanceof PsiJavaFile javaFile) { if (params.get("autoImportPackages") != null) { // keep this for old user templates autoImportPackages(javaFile, params.get("autoImportPackages")); } } method = (PsiMethod)JavaCodeStyleManager.getInstance(clazz.getProject()).shortenClassReferences(method); // jump to method if (!config.isJumpToMethod() || editor == null) { return; } int offset = method.getTextOffset(); if (offset <= 2) { return; } VisualPosition vp = editor.offsetToVisualPosition(offset); if (logger.isDebugEnabled()) logger.debug("Moving/Scrolling caret to " + vp + " (offset=" + offset + ")"); editor.getCaretModel().moveToVisualPosition(vp); editor.getScrollingModel().scrollToCaret(ScrollType.CENTER_DOWN); }