CompilationUnitContext cuc = (CompilationUnitContext) arg0.getParent();
List<ParseTree> children = cuc.children;
int tokenIndex = arg0.getSymbol().getTokenIndex();
if (arg0.getParent() instanceof CompilationUnitContext) {
CompilationUnitContext cuc = (CompilationUnitContext) arg0.getParent();
AutocompleteCandidate c = new AutocompleteCandidate(JavaCompletionTypes.INITIAL, arg0.getText());
addQuery(c, cursor);
completeClassFromPath(cuc, arg0.getText());
return;
} else if (arg0.getParent() instanceof BlockStatementContext) {
if (!arg0.getSymbol().getText().equals(".")) {
AutocompleteCandidate c = new AutocompleteCandidate(JavaCompletionTypes.BLOCKLEVEL, arg0.getText());
addQuery(c, cursor);
} else {
BlockStatementContext bs = (BlockStatementContext) arg0.getParent();
if (bs.getChildCount() > 1) {
addQuery(classUtils.expandExpression(bs.getText(), registry, classUtils.DO_ALL), cursor);
} else if (arg0.getParent() instanceof ExpressionContext) {
ParseTree chld = arg0.getParent().getChild(arg0.getParent().getChildCount() - 1);
if (!chld.equals(arg0)) return;
addQuery(classUtils.expandExpression(arg0.getParent().getText(), registry, classUtils.DO_NON_STATIC), cursor);
} else if (arg0.getParent() instanceof TypeDeclarationContext &&
arg0.getParent().getParent() != null &&
arg0.getParent().getParent() instanceof CompilationUnitContext) {