private static PsiMember findMember(@NotNull PsiElement element) {
    while (true) {
      PsiMember member =
        PsiTreeUtil.getParentOfType(element, PsiMember.class, false, PsiCodeBlock.class, PsiStatement.class, PsiExpression.class);
      if (!(member instanceof PsiTypeParameter)) {
        return member;
      }
      element = member.getParent();
    }
  }
private static PsiMember findMember(@NotNull PsiElement element)