void (String text, EditorTextField editor) { editor.setText(text); editor.selectAll(); final Document document = editor.getDocument(); final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject); documentManager.commitDocument(document); final PsiFile file = documentManager.getPsiFile(document); if (file == null) return; WriteCommandAction.runWriteCommandAction(myProject, SSRBundle.message("command.name.adjust.line.indent"), "Structural Search", () -> CodeStyleManager.getInstance(myProject) .adjustLineIndent(file, new TextRange(0, document.getTextLength())), file); }