@Override
  public Comparable<?> weigh(@NotNull PsiElement element, @NotNull ProximityLocation location) {
    PsiElement position = location.getPosition();
    if (position == null) {
      return null;
    }
    if (!INSIDE_PSI_MEMBER.getValue(location)) {
      return 0;
    }
    if (element.isPhysical()) {
      position = PHYSICAL_POSITION.getValue(location);
    }

    final PsiMember member = PsiTreeUtil.getContextOfType(PsiTreeUtil.findCommonContext(position, element), PsiMember.class, false);
    if (member instanceof PsiClass) return 1;
    if (member != null) return 2;
    return 0;
  }
@Override
  public Comparable<?> weigh(@NotNull PsiElement element, @NotNull ProximityLocation location)