@Override
  public LookupElement[] calculateLookupItems(Expression @NotNull [] params, ExpressionContext context) {
    if (params.length == 0) return LookupElement.EMPTY_ARRAY;
    Result paramResult = params[0].calculateQuickResult(context);
    if (paramResult instanceof PsiTypeResult) {
      return suggestSubTypes(context, ((PsiTypeResult)paramResult).getType());
    }
    if (paramResult instanceof TextResult) {
      PsiElement contextPsi = context.getPsiElementAtStartOffset();
      if (contextPsi != null) {
        PsiElementFactory factory = JavaPsiFacade.getElementFactory(context.getProject());
        try {
          return suggestSubTypes(context, factory.createTypeFromText(((TextResult)paramResult).getText(), contextPsi));
        }
        catch (IncorrectOperationException e) {
          LOG.debug(e);
        }
      }
    }
    return LookupElement.EMPTY_ARRAY;
  }
@Override
  public LookupElement[] calculateLookupItems(Expression @NotNull [] params, ExpressionContext context)