PsiElement[] (Expression[] params, final ExpressionContext context) { if (params.length != 0) return null; Project project = context.getProject(); final int offset = context.getStartOffset(); final ArrayList<PsiVariable> array = new ArrayList<>(); PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(context.getEditor().getDocument()); PsiElement place = file.findElementAt(offset); PsiVariable[] variables = MacroUtil.getVariablesVisibleAt(place, ""); for (PsiVariable variable : variables) { PsiType type = VariableTypeCalculator.getVarTypeAt(variable, place); if (type instanceof PsiArrayType) { array.add(variable); } } return array.toArray(new PsiVariable[0]); }