void (@NotNull DirDiffElementImpl element) { DiffElement<?> source = element.getSource(); DiffElement<?> target = element.getTarget(); LOG.assertTrue(source == null || target == null); if (source instanceof AsyncDiffElement || target instanceof AsyncDiffElement) { ((AsyncDiffElement)(source != null ? source : target)).deleteAsync() .onError(error -> reportException(error != null ? error.getMessage() : null)) .onSuccess(result -> { if (!myDisposed && myElements.contains(element)) { removeElement(element, true); } }); } else { if (myElements.contains(element)) { removeElement(element, true); } WriteAction.run( () -> (source != null ? source : target).delete()); } }