private static @Nullable PsiElement getReferencedElement(@NotNull PsiReference ref, int flags) {
    final Language language = ref.getElement().getLanguage();
    TargetElementEvaluator evaluator = TARGET_ELEMENT_EVALUATOR.forLanguage(language);
    if (evaluator != null) {
      final PsiElement element = evaluator.getElementByReference(ref, flags);
      if (element != null) {
        return element;
      }
    }
    return ref.resolve();
  }
private static @Nullable PsiElement getReferencedElement(@NotNull PsiReference ref, int flags)