FindUsagesHandler (@NotNull PsiElement element, boolean forHighlightUsages) { return new FindUsagesHandler(element) { @Override public PsiElement @NotNull [] getSecondaryElements() { final PsiMember psiMember = (PsiMember) getPsiElement(); final PsiClass containingClass = psiMember.getContainingClass(); if (containingClass != null) { final Collection<PsiElement> elements = new ArrayList<>(); processClass(containingClass, psiMember, elements); Arrays.stream(containingClass.getInnerClasses()) .forEach(psiClass -> processClass(psiClass, psiMember, elements)); return PsiUtilCore.toPsiElementArray(elements); } return PsiElement.EMPTY_ARRAY; } private static void processClass(PsiClass containingClass, PsiMember refPsiField, Collection<PsiElement> collector) { processClassMethods(containingClass, refPsiField, collector); processClassFields(containingClass, refPsiField, collector); } private static void processClassFields(PsiClass containingClass, PsiMember refPsiField, Collection<PsiElement> collector) { Arrays.stream(containingClass.getFields()) .filter(LombokLightFieldBuilder.class::isInstance) .filter(psiField -> psiField.getNavigationElement() == refPsiField) .forEach(collector::add); } private static void processClassMethods(PsiClass containingClass, PsiMember refPsiField, Collection<PsiElement> collector) { Arrays.stream(containingClass.getMethods()) .filter(LombokLightMethodBuilder.class::isInstance) .filter(psiMethod -> psiMethod.getNavigationElement() == refPsiField) .forEach(collector::add); } }; }