@NotNull
  public static @InspectionMessage String getErrorDescription(@NotNull PsiReference reference) {
    @InspectionMessage String message;
    if (reference instanceof EmptyResolveMessageProvider) {
      message = ((EmptyResolveMessageProvider)reference).getUnresolvedMessagePattern();
    }
    else {
      //noinspection UnresolvedPropertyKey
      message = AnalysisBundle.message("cannot.resolve.symbol");
    }

    String description;
    try {
      //noinspection HardCodedStringLiteral
      description = BundleBase.format(message, reference.getCanonicalText()); // avoid double formatting
    }
    catch (IllegalArgumentException ex) {
      // unresolvedMessage provided by third-party reference contains wrong format string (e.g. {}), tolerate it
      description = message;
    }
    return description;
  }
@NotNull
  public static @InspectionMessage String getErrorDescription(@NotNull PsiReference reference)