@Nullable("No type element found")
  @Contract(pure = true)
  private static PsiTypeElement getTypeElement(@NotNull final PsiElement startElement) {
    PsiElement parent = PsiTreeUtil.getParentOfType(startElement, PsiTypeElement.class, PsiVariable.class, PsiMethod.class);
    if (parent instanceof PsiTypeElement typeElement) {
      return typeElement;
    }
    if (parent instanceof PsiVariable variable) {
      return variable.getTypeElement();
    }
    if (parent instanceof PsiMethod method) {
      return method.getReturnTypeElement();
    }
    return null;
  }
@Nullable("No type element found")
  @Contract(pure = true)
  private static PsiTypeElement getTypeElement(@NotNull final PsiElement startElement)