void (@NotNull Project project, CommonProblemDescriptor @NotNull [] descriptors, @NotNull List<PsiElement> psiElementsToIgnore, @Nullable Runnable refreshViews) { final PsiElement[] elements = Stream.of(descriptors) .map(d -> ((ProblemDescriptor)d).getPsiElement().getParent()) .filter(e -> e instanceof PsiNamedElement) .toArray(PsiElement[]::new); SafeDeleteHandler.invoke(project, elements, false); }