void (@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) { if (!EditorModificationUtil.checkModificationAllowed(editor)) return; if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)) { return; } final PsiClass aClass = OverrideImplementUtil.getContextClass(project, editor, file, false); if (aClass == null || aClass.isInterface()) return; //? LOG.assertTrue(aClass.isValid()); LOG.assertTrue(aClass.getContainingFile() != null); try { final ClassMember[] members = chooseOriginalMembers(aClass, project, editor); if (members == null) return; CommandProcessor.getInstance().executeCommand(project, () -> { final int offset = editor.getCaretModel().getOffset(); try { doGenerate(project, editor, aClass, members); } catch (GenerateCodeException e) { final String message = e.getMessage(); ApplicationManager.getApplication().invokeLater(() -> { if (!editor.isDisposed()) { editor.getCaretModel().moveToOffset(offset); HintManager.getInstance().showErrorHint(editor, message); } }, project.getDisposed()); } }, null, null); } finally { cleanup(); } }