void (InsertionContext context, List<PsiGenerationInfo<PsiMethod>> infos) { List<PsiGenerationInfo<PsiMethod>> newInfos = GenerateMembersUtil .insertMembersAtOffset(context.getFile(), context.getStartOffset(), infos); if (!newInfos.isEmpty()) { final List<PsiElement> elements = new ArrayList<>(); for (GenerationInfo member : newInfos) { if (!(member instanceof TemplateGenerationInfo)) { ContainerUtil.addIfNotNull(elements, member.getPsiMember()); } } newInfos.get(0).positionCaret(context.getEditor(), true); GlobalInspectionContextBase.cleanupElements(context.getProject(), null, elements.toArray(PsiElement.EMPTY_ARRAY)); } }