void (@NotNull ActionContext context, @NotNull PsiErrorElement element, @NotNull ModPsiUpdater updater) { PsiFile file = element.getContainingFile(); MemberInfo rangeAndMember = createMember(file, element); if (rangeAndMember == null) return; Document document = file.getViewProvider().getDocument(); TextRange memberRange = rangeAndMember.range(); PsiMember member = rangeAndMember.member(); PsiClass psiClass = getPsiClass(file, member); if (psiClass == null) return; if (psiClass.getContainingFile() != file) { psiClass = (PsiClass)file.add(psiClass); } PsiDocumentManager documentManager = PsiDocumentManager.getInstance(context.project()); documentManager.doPostponedOperationsAndUnblockDocument(document); SmartPsiElementPointer<PsiClass> classPtr = SmartPointerManager.createPointer(psiClass); document.deleteString(memberRange.getStartOffset(), memberRange.getEndOffset()); documentManager.commitDocument(document); psiClass = classPtr.getElement(); if (psiClass == null) return; PsiElement rBrace = psiClass.getRBrace(); if (rBrace == null) return; psiClass.addBefore(member, rBrace); }