void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement myTag = doIfNotNull(descriptor.getPsiElement(), PsiElement::getParent); try { if (myTag instanceof RncDefine && myTag.isValid()) { myTag.delete(); } } catch (IncorrectOperationException e) { Logger.getInstance(UnusedDefineInspection.class.getName()).error(e); } }