void (Collection<ReferenceExpressionInfo> infos, PsiElement elem, GrMethod method) { if (elem instanceof GrReferenceExpression expr) { PsiReference ref = expr.getReference(); if (ref != null) { PsiElement declaration = ref.resolve(); if (declaration instanceof GrMember member) { int offsetInMethod = expr.getTextRange().getStartOffset() - method.getTextRange().getStartOffset(); infos.add(new ReferenceExpressionInfo(expr, offsetInMethod, member, member.getContainingClass())); } } } for (PsiElement element : elem.getChildren()) { collectReferenceInfoImpl(infos, element, method); } }