void (@NotNull InsertionContext context, int offset) { Project project = context.getProject(); PsiDocumentManager.getInstance(project).commitDocument(context.getDocument()); CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project); codeStyleManager.reformatText(context.getFile(), context.getStartOffset(), context.getTailOffset() + offset); }