private static @Nullable String getText(@NotNull PsiElement textElement) {
    String text = textElement.getText();

    if (textElement instanceof PsiNamedElement) {
      text = ((PsiNamedElement)textElement).getName();
    }

    return text;
  }
private static @Nullable String getText(@NotNull PsiElement textElement)