Set<String> (final PsiClassType type, final PsiElement context) { PsiVariable[] variables = MacroUtil.getVariablesVisibleAt(context, ""); Set<String> result = new LinkedHashSet<>(); for (PsiVariable var : variables) { PsiType varType = var.getType(); PsiIdentifier identifier = var.getNameIdentifier(); if ((type == null || type.isAssignableFrom(varType)) && identifier != null) { result.add(identifier.getText()); } } PsiExpression[] expressions = MacroUtil.getStandardExpressionsOfType(context, type); for (PsiExpression expression : expressions) { result.add(expression.getText()); } if (type != null) { addAvailableMethodsOfType(type, context, result); } return result; }