void (@NotNull Project project, @NotNull Editor editor, int offset) { Document document = editor.getDocument(); final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project); documentManager.commitDocument(document); PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document); if (file == null) return; CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project); try { codeStyleManager.adjustLineIndent(file, offset); } catch (IncorrectOperationException e) { LOG.error(e); } }