void (@NotNull PsiElement highlightedElement, @NotNull HighlightInfo highlightInfo) { PsiElement importantParent = PsiTreeUtil.getParentOfType(highlightedElement, PsiMethod.class, PsiLambdaExpression.class, PsiMethodReferenceExpression.class, PsiClassInitializer.class ); // applicable only for methods if (importantParent instanceof PsiMethod) { AddAnnotationFix fix = new AddAnnotationFix(LombokClassNames.SNEAKY_THROWS, (PsiModifierListOwner) importantParent); highlightInfo.registerFix(fix, null, null, null, null); } }