protected void attachOrphanCompletionNode(){ if (this.isOrphanCompletionNode){ ASTNode orphan = this.assistNode; this.isOrphanCompletionNode = false; /* if in context of a type, then persists the identifier into a fake field return type */ if (this.currentElement instanceof RecoveredType){ RecoveredType recoveredType = (RecoveredType)this.currentElement; /* filter out cases where scanner is still inside type header */ if (recoveredType.foundOpeningBrace) { /* generate a pseudo field with a completion on type reference */ if (orphan instanceof TypeReference){ this.currentElement = this.currentElement.add(new SelectionOnFieldType((TypeReference)orphan), 0); return; } } } if (orphan instanceof Expression) { buildMoreCompletionContext((Expression)orphan); } else { Statement statement = (Statement) orphan; this.currentElement = this.currentElement.add(statement, 0); } this.currentToken = 0; // given we are not on an eof, we do not want side effects caused by looked-ahead token } } private void buildMoreCompletionContext(Expression expression) {
buildMoreCompletionContext((Expression)orphan); } else { if (lastIndexOfElement(K_LAMBDA_EXPRESSION_DELIMITER) < 0) { // lambdas are recovered up to the containing expression statement and will carry along the assist node anyways.
buildMoreCompletionContext((Expression)orphan); } else { if (lastIndexOfElement(K_LAMBDA_EXPRESSION_DELIMITER) < 0) { // lambdas are recovered up to the containing expression statement and will carry along the assist node anyways.
buildMoreCompletionContext((Expression)orphan); } else { if (lastIndexOfElement(K_LAMBDA_EXPRESSION_DELIMITER) < 0) { // lambdas are recovered up to the containing expression statement and will carry along the assist node anyways.
buildMoreCompletionContext((Expression)orphan); } else { if (lastIndexOfElement(K_LAMBDA_EXPRESSION_DELIMITER) < 0) { // lambdas are recovered up to the containing expression statement and will carry along the assist node anyways.
buildMoreCompletionContext((Expression)orphan); } else { if (lastIndexOfElement(K_LAMBDA_EXPRESSION_DELIMITER) < 0) { // lambdas are recovered up to the containing expression statement and will carry along the assist node anyways.