void () { PsiDocumentManager.getInstance(myProject).commitAllDocuments(); myUsageView.close(); ArrayList<PsiElement> elements = new ArrayList<>(); for (SmartPsiElementPointer<?> pointer : myPointers) { PsiElement element = pointer.getElement(); if (element != null) { elements.add(element); } } if(!elements.isEmpty()) { SafeDeleteHandler.invoke(myProject, PsiUtilCore.toPsiElementArray(elements), true); } }