@Override
  @NotNull
  public String getCanonicalText() {
    switch (getKind()) {
      case PACKAGE_REFERENCE, IMPORT_REFERENCE -> {
        return getTextSkipWhiteSpaceAndComments();
      }
      case REFERENCE -> {
        final PsiElement target = resolve();
        if (target instanceof PsiTypeParameter) {
          return StringUtil.notNullize(((PsiTypeParameter)target).getName());
        }
        else if (target instanceof PsiClass aClass) {
          String name = aClass.getQualifiedName();
          if (name == null) return "";

          final PsiType[] types = getTypeArguments();
          if (types.length == 0) return name;

          final StringBuilder buf = new StringBuilder();
          buf.append(name);
          buf.append('<');
          for (int i = 0; i < types.length; i++) {
            if (i > 0) buf.append(',');
            buf.append(types[i].getCanonicalText());
          }
          buf.append('>');

          return buf.toString();
        }
        else if (target instanceof PsiPackage) {
          return ((PsiPackage)target).getQualifiedName();
        }
        else {
          LOG.assertTrue(target == null);
          return getTextSkipWhiteSpaceAndComments();
        }
      }
      default -> throw new IllegalStateException();
    }
  }
@Override
  @NotNull
  public String getCanonicalText()