private static boolean isCorrectTarget(@NotNull PsiMethod method) {
    if (method instanceof GrTraitMethod) return false;

    final PsiElement navigationElement = method.getNavigationElement();
    return method.isPhysical() || navigationElement.isPhysical() && !(navigationElement instanceof PsiClass);
  }
private static boolean isCorrectTarget(@NotNull PsiMethod method)