void (@NotNull PsiElement element, @NotNull AnnotationHolder holder) { if (element.getText().equals("hello")) { holder.newAnnotation(HighlightSeverity.ERROR, "i hate it") .newFix(new DeleteElementFix(element) { @Override protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiElement element) { return FIX_ENABLED ? super.getPresentation(context, element) : null; } }.asIntention()).registerFix().create(); iDidIt(); } }