Result (Expression @NotNull [] params, final ExpressionContext context) { if (params.length != 1) return null; final Result result = params[0].calculateResult(context); if (result == null) return null; if (result instanceof PsiTypeResult) { PsiType type = ((PsiTypeResult) result).getType(); if (type instanceof PsiArrayType) { return new PsiTypeResult(((PsiArrayType) type).getComponentType(), context.getProject()); } } PsiExpression expr = MacroUtil.resultToPsiExpression(result, context); PsiType type = expr == null ? MacroUtil.resultToPsiType(result, context) : expr.getType(); if (type instanceof PsiArrayType) { return new PsiTypeResult(((PsiArrayType) type).getComponentType(), context.getProject()); } LookupElement[] elements = params[0].calculateLookupItems(context); if (elements != null) { for (LookupElement element : elements) { PsiTypeLookupItem typeLookupItem = element.as(PsiTypeLookupItem.CLASS_CONDITION_KEY); if (typeLookupItem != null) { PsiType psiType = typeLookupItem.getType(); if (psiType instanceof PsiArrayType) { return new PsiTypeResult(((PsiArrayType)psiType).getComponentType(), context.getProject()); } } } } return new PsiElementResult(null); }