use of dyvilx.tools.repl.context.REPLContext in project Dyvil by Dyvil.
the class CompleteCommand method printREPLMembers.
private void printREPLMembers(DyvilREPL repl, String start) {
final REPLContext replContext = repl.getContext();
final Set<IField> variables = new TreeSet<>(MemberSorter.MEMBER_COMPARATOR);
final Set<IMethod> methods = new TreeSet<>(MemberSorter.METHOD_COMPARATOR);
for (IField variable : replContext.getFields().values()) {
checkMember(variables, variable, start);
}
for (IMethod method : replContext.getMethods()) {
checkMember(methods, method, start);
}
final PrintStream output = repl.getOutput();
boolean hasOutput = false;
if (!variables.isEmpty()) {
hasOutput = true;
output.println(I18n.get("command.complete.variables"));
printMembers(output, variables, null);
}
if (!methods.isEmpty()) {
hasOutput = true;
output.println(I18n.get("command.complete.methods"));
printMethods(output, methods, null);
}
if (!hasOutput) {
output.println(I18n.get("command.complete.none"));
}
}
Aggregations